Link
Insert linking anchors or pointers into report
Description
This component inserts linking anchors or pointers into the report.
For a PDF report, if you open the report from MATLAB® (for example, if you open the report right after generating it), the link does not work. However, if you open a PDF report outside of MATLAB (for example, from Adobe® Acrobat®), the link works properly.
Properties
Link type: Select the type of link to insert into the report. Options include:
Linking anchor
: Specifies a link to an anchor.Internal document link
: Specifies a location in the report (as specified by an anchor).URL (external) link
: Specifies a link to a Web site or to a MATLAB command to execute from generated report.
Link identifier: Indicates the location to which the link points. It can contain only ASCII characters, and it is not visible in the generated report.
For a Web link, the link identifier options are context sensitive; their formats differ depending on the link type you select. For example, to link to an external file
foo.txt
, specify the link identifier as follows:On UNIX® systems:
file:///home/janedoe/foo.txt
On Microsoft® Windows® systems:
H:\foo.txt
For a link to a MATLAB command, enter
matlab:
followed by a space and the MATLAB command that you want the link to execute.Link text: Specifies text to use in the link.
Emphasize link text: Italicizes the link text.
Examples
Link to an External Web Site
Open Report Explorer with the
setedit
command.In the Properties pane on the right, click Create and edit a new Report file.
In the Library pane in the middle, under the Formatting category, select the Text component and click the Add component to current report icon.
In the Properties pane, enter
Open the
(add a blank space at the end of the text).In the Library pane, under the Formatting category, select the Link component and click the Add component to current report icon.
In the Properties pane:
Set Link type to
URL (external) link
.In Link Identifier, enter
https://www.mathworks.com
.In Link text, enter
MathWorks Web site
.
Generate the report.
Click the link to open the MathWorks® website.
Link to Another Place in a Report
At the MATLAB command line, enter
setedit magic-square.rpt
.In the Outline pane on the left, select the Title Page component.
In the Library pane in the middle, under the Formatting category, select the Link component and click the Add component to current report icon.
In the Properties pane:
Set Link type to
Linking anchor
.In Link identifier, enter
explanation
.
In the Contents pane, the Link component appears as
Anchor - explanation
.In the Outline pane, under the second Chapter component, select the Eval component.
In the Library pane, under the Formatting category, select the Paragraph component and click the Add component to current report icon.
In the Library pane, under the Formatting category, select the Link component and click the Add component to current report icon.
In the Properties pane:
Set Link type to
Internal document link
.In Link identifier, enter
explanation
.In Link text, enter
For a detailed explanation, click here
.
Generate the report.
Click the link to move to near the top of the report, to “Chapter 1. Magic Squares Explained.”
Link to a Model
This example shows how to add a link from a report to a Simulink® model. To create and run this report, you must have Simulink installed.
Open Report Explorer with the
setedit
command.In the report library, under
data (\examples\rptgenext)
, selectsimulink-default.rpt
and open it.From the component library, under Formatting, select the Paragraph component and add it to your report setup file after the Model Loop Chapter component.
Add a Link component after the new Paragraph component. Set these properties:
Set Link type to
URL (external) link
.In Link Identifier, enter
matlab:open_system('%<RptgenSL.getReportedModel()>')
.In Link text, enter
Open model
.
Generate the report.
To open the model from the report, click the link.
Insert Anything into Report?
Yes. Text or anchor.
Class
rptgen.cfr_link
See Also
Chapter/Subsection
, Empty Component
, List
, Paragraph
, Table
, Text
, Title Page