A presentation document requires a special document template. This template does not contain any content order, and all text content is always placed 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 a Text box position. You can also place a Text box in the same positions as others (Figure 1).

Sample of PPTX Template
Figure 1: Sample of PPTX template.

Multi-line statements in PPTX

Similar to XLSX, all multi-line directives such as #if, #else, #elseif, #foreach, and #macro must be used under the following conditions.

  1. The beginning and ending statements must be declared within a single text box. The following code shows a sample of invalid usage of the#foreach statement between the text boxes.

    Since the PPTX template does not provide the statement order, the template will not be interpreted as the order of the displayed images (text boxes). For example, $uc.name may not be processed after #foreach($uc in $UseCase) has been completely processed. The following code demonstrates a sample of valid usage of the #foreach statement.

  2. A VTL Macro must be declared within a single text box. Do not insert the multi-cell recorded macros in a single text box. See the following code example.


Since each text box does not have any sequence order, the macro cannot record any content between the text boxes. The following code example demonstrates a valid usage of the #macro statement.

Creating data for multiple slides

In PPTX report templates, you can use the #forpage directive to create additional slide(s) in your presentation. You can use #forpage and #endpage directives in any text box. However, the #endpage directive must be on same slide as the #forpage directive or on the following slide, but not before the slide which contains the #forpage directive. All directives on the slide(s) between 1) the slide the #forpage directive appears and 2) the slide the #endpage directive appears will be included within the #forpage statement. For example, the template in Figure 2 will produce the output as shown in Figure 3.
 


Figure 2: Creating data for multiple pages using the forpage directive.

 


Figure 3: Results of running the code from Figure 2.

Creating a page with conditions

Since a directive in the PPTX report template does not provide any statement order (unless residing in the same text box), you cannot used the #if directive together with the #forpage directive. See figure below.

Sample of Looping With Condition in General Style

The code above will not produce the output report as expected, because the #forpage directive automatically covers all directives in the current page regardless of the statement order. Consequently, the #if directive may not be interpreted after the #forpage directive.

To avoid this problem, you can use the $report.filterElement($elements, $types) method. This helper method provides the element filter for the specified type. In this case, use the following code.

Sample of Looping With Conditional Filter

For more details on $report.filterElement($elements, $types), see Section Helper Modules.

Limitation when used in Microsoft Office PowerPoint presentation

#sectionBegin, #includeSection cannot be used in any PPTX report template. If you try, for example, to use #sectionBegin in a PPTX report template, an error message (Figure 4) will open.

 


Figure 4: The error message dialog that appears from running an invalid sectionBegin directive.