Documentation Center

  • Trial Software
  • Product Updates

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

  1. Open Report Explorer with the setedit command.

  2. In the Properties pane on the right, click Create and edit a new report file.

  3. In the Library pane in the middle, under the Formatting category, select the Text component and click the Add component icon.

  4. In the Properties pane, enter Open the (add a blank space at the end of the string).

  5. In the Library pane, under the Formatting category, select the Link component and click the Add component icon.

  6. In the Properties pane:

    • Set Link type to URL (external) link.

    • In Link Identifier, enter http://www.mathworks.com.

    • In Link text, enter MathWorks Web site. (with a period).

  7. Generate the report.

  8. Click the link to open the MathWorks® Web site.

Link to Another Place in a Report

  1. At the MATLAB command line, enter setedit magic-square.rpt.

  2. In the Outline pane on the left, select the Title Page component.

  3. In the Library pane in the middle, under the Formatting category, select the Link component and click the Add component icon.

  4. 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.

  5. In the Outline pane, under the second Chapter component, select the Eval component.

  6. In the Library pane, under the Formatting category, select the Paragraph component and click the Add component icon.

  7. In the Library pane, under the Formatting category, select the Link component and click the Add component icon.

  8. 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. (with the period).

  9. Generate the report.

  10. 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 to a Simulink® model. To view the model, you must have the Simulink software installed.

  1. Open Report Explorer with the setedit command.

  2. In the middle pane, click simulink-default_rptgensl_version.rpt.

  3. In the Library pane in the middle, under the Formatting category, select the Paragraph component and click the Add component icon.

  4. In the Library pane in the middle, under the Formatting category, select the Link component and click the Add component icon.

  5. In the Properties pane:

    • Set Link type to URL (external) link.

    • In Link Identifier, enter matlab:open_system('%<RptgenSL.getReportedModel()>').

    • In Link text, enter Open model.

  6. Generate the report.

  7. Click the "Open model" link to open the model.

Insert Anything into Report?

Yes. Text or anchor.

Class

rptgen.cfr_link

Was this topic helpful?