A presentation document is a special document template. This template does not contain a content order. The text content used within this document is inserted inside a text box. A text box is an image structure (An image structure keeps the position of each image in x, y coordinates).
You can change the position of a Text box. You can also place Text boxes in the same positions as others, see figure below.
A sample of ODP Template.
Using the same concept as ODS, all multi-line directives such as #if-#else-#elseif, #foreach, and #macro must be used under conditions.
- The beginning and ending statements must be declared within a single text box. The figure below shows the sample of invalid usage of the multi-line #foreach statement between the text boxes.
Invalid Usage of Multiline Statement in ODP.
Since the ODP template does not provide the statement order, the template will not be interpreted in the order of the displayed images. For example, $uc.name may not be processed after #foreach($uc in $UseCase) has been completed.
The figure below shows the sample of valid usage of the #foreach statement.
A sample of valid usage of the foreach statement.
- A VTL Macro must be declared within a single text box. Do not insert the multi-cell recorded macros in a single text box as shown in figure below.
Invalid Usage of Macro Statement in ODP.
The text box does not have a sequence order; therefore, macros cannot record any content between the text boxes, see figure below.
Valid Usage of Macro Statement in ODP.
Creating Data for Multiple Slides
ODP uses the #forpage directive to create a slide for each data. The #forpage directive does not contain any order. You can use #forpage and #endpage in any text boxes. All directives on the slide will be included within the #forpage statement, see figure below.
A sample usage of the forpage directive.
The output from the code, shown in figure below, is an ODP with a single use case name for each slide.
The result of running the code from the figure above.
For more samples of ODP reports, see the “Other Document” template.
Creating Page with Conditions
The ODP directive does not provide any statement order; therefore, the #if directive will not be attached to the #forpage statement, as shown in figure below.
A sample of Looping with Condition in General Style.
The codes in the figure above may not produce the report exactly as expected. #forpage automatically covers all directives in the current page without any statement order. Therefore, the #if directive may not be interpreted after #forpage.
To solve this problem you can use the $report.filterElement($elements, $types) method. This helper method provides the element filter for the specified type. The codes are shown in the figure below:
A sample of Looping with Conditional Filter.
For more details on $report.filterElement($elements, $types), see Section Helper tools.