How to create a template for an OpenDocument Presentation (ODP) or Microsoft PowerPoint presentation (PPTX)
- Open OpenOffice.org Impress or Microsoft PowerPoint.
- Add the code to the template file.
- Save the template file.
- Add the template to Report Wizard.
A presentation document is a special document template that does not contain a content order. It uses a text box to insert text as the content of the document. 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, or place it in the same position as others.
Writing VTL in a text box in OpenOffice.org Impress
The following are the rules that you need to follow when using the #if, #elseif, #else, #foreach, #forpage, and #macro directives in *.odp and .pptx documents:
VTL statements that maintain a sequence order, such as #if and #foreach, must begin and end the statements inside the same text box.
Valid use of multi-line statement in ODP
Do not split the statements into several text boxes, as this will cause an error.
Invalid use of a multi-line statement in ODP
A #macro statement must be declared in the same text box.
Valid use of macro statement in ODP
The #forpage statement is different from the others, as it does not contain any order. It can begin and end the statement in different text boxes. Its value can also be used in different text boxes.
Valid use of the #forpage statement in ODP
To use a structured statement such as #if, #macro, or #foreach with the #forpage statement, ensure that the statement is in the same text box.
Valid use of #if and #foreach with #forpage statement
Using an example from the previous figure, the generated result will be as follows:
The end result of using #if and #foreach with #forpage statement.
Glossary
The Velocity Template Language (VTL) is meant to provide an easy, simple, and clean way to incorporate dynamic content in a web page. A VTL statement begins with the #
character and contains a directive: set
.
More information about working with Velocity Template Language (VTL)
To learn more about working with Velocity Template Language (VTL), visit the following pages: