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.
Run the following command to access the supporting files used in this example.
openExample('rptgen/MatlabReportGeneratorSupportFilesExample');
At the MATLAB® command prompt, enter:
setedit figloop-tutorial
To display the Handle Graphics figures, enter:
figloopfigures
The figures
Membrane Data
,An Application
, andPeaks Data
appear on the screen because theirvisible
property is'on'
. TheInvisible Membrane Data
andAn Invisible Application
figures do not appear on screen because theirvisible
property is'off'
. These invisible figures exist, but they are hidden.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.
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.
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.
Select the Data figures only (Exclude applications) option to exclude figures from the loop whose
HandleVisibility
parameter is'off'
.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:
From the Include figures list, select
All figures with tags
.In the list of tags, delete
membrane
.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:
Enter
membrane
back in the list of tags.Generate the
figloop-tutorial
report.The figures produced by the loop are:
Membrane Data Invisible Membrane Data An Application An Invisible Application
Enable the Create section for each object in loop option.
Enable the Display the Object Type in the Section Title option.
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.