Main Content

Edit Figure Loop Components

Figure Loop in a Report

This example uses the Figure Loop, which is representative of many types of loops. The Figure Loop component runs its child components several times. In each iteration, the Figure Loop applies its child components to Handle Graphics® figures. The figloop-tutorial report setup file creates a report that documents several Handle Graphics figures.

  1. Run the following command to access the supporting files used in this example.

    openExample('rptgen/MatlabReportGeneratorSupportFilesExample');
  2. At the MATLAB® command prompt, enter:

    setedit figloop-tutorial
    

  3. To display the Handle Graphics figures, enter:

    figloopfigures

    The figures Membrane Data, An Application, and Peaks Data appear on the screen because their visible property is 'on'. The Invisible Membrane Data and An Invisible Application figures do not appear on screen because their visible property is 'off'. These invisible figures exist, but they are hidden.

  4. In the Report Explorer, in the Outline pane on the left, select the Figure Loop component called Figure Loop Section 1.

    The Properties pane for the Figure Loop component appears.

Properties pane for Figure Loop component

Figure Properties

Figure properties control which figures appear in the report. Table 1.1 of the figloop-tutorial report includes a summary of the properties of the figures used in this tutorial.

Table with summary of figure properties for the figures used in the tutorial

For this example, do not change these properties. For more information, see Add, Replace, and Delete Properties in Tables.

Loop on the Current Figure

To include only the current figure in the report, from the Include figures list, select Current figure only. The current figure is the figure that is current when the report generates. This figure may not be the same figure that you selected as the current figure in the Report Explorer before report generation. For example, if the report generation process creates figures in your report, the last figure created with HandleVisibility set to 'on' is the current figure.

Loop on Visible Figures

To include snapshots of all visible figures in your report, in the Include figures selection list, select Visible figures. This option inserts a snapshot and Property Table for all figures that are currently open and visible.

  1. Select the Data figures only (Exclude applications) option to exclude figures from the loop whose HandleVisibility parameter is 'off'.

  2. To generate the report, in the Report Explorer toolbar click the Report button.

In the generated report, scroll down to “Chapter 2 Figures in Report.” The Membrane Data and Peaks Data figures appear in the generated report.

Loop on Figures with Tags

To include figures with specified tags in the report:

  1. From the Include figures list, select All figures with tags.

  2. In the list of tags, delete membrane.

  3. Click Report to generate the report.

The An Application and An Invisible Application figures appear in the report. They both have an app tag.

Modify Loop Section Options

In a loop, a section refers to a space in the generated report in which information, including text, images, and tables, appears. You can alter the appearance of sections in each loop appear in the report by using the options in the Figure Loop component's Section Options pane.

  • Create Section for Each Object in Loop — Create an individual section for each object found in the loop, using the object title as the section title. This option is useful when a loop does not contain a Chapter/Subsection component that organizes the loop results.

  • Display the Object Type in the Section Title — Precede section titles with object titles. Enable this option by selecting Create section for each object in loop. For example:

    1. Enter membrane back in the list of tags.

    2. Generate the figloop-tutorial report.

      The figures produced by the loop are:

      Membrane Data
      Invisible Membrane Data
      An Application
      An Invisible Application
      

    3. Enable the Create section for each object in loop option.

    4. Enable the Display the Object Type in the Section Title option.

    5. Generate the figloop-tutorial report.

      The figures produced are now:

      Figure - Membrane Data
      Figure - Invisible Membrane Data
      Figure - An Application
      Figure - An Invisible Application
      

      The figures produced are now:

      Figure - Membrane Data
      Figure - Invisible Membrane Data
      Figure - An Application
      Figure - An Invisible Application
      

  • Create a Link Anchor for Each Object in Loop — Create a hyperlink to the object in the generated report.