On this page

To create a template for an OpenDocument Presentation (ODP) or Microsoft PowerPoint presentation (PPTX)


  1. Open OpenOffice.org Impress or Microsoft PowerPoint.
  2. Add the code to the template file.
  3. Save the template file.
  4. 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

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:

  • Statement

    VTL statements that maintain a sequence order, such as #if and #foreach, must begin and end the statements inside the same text box.

    Valid Usage of a Multi-line Statement in ODP

     Valid use of multi-line statement in ODP.

    Do not split the statements into several text boxes, as this will cause an error.

    Invalid Usage of a Multi-line Statement in ODP

    Invalid use of a multi-line statement in ODP.
  • #macro statement

    A #macro statement must be declared in the same text box.

    Valid Usage of Macro Statement in ODP

    Valid use of macro statement in ODP.
  • #forpage statement

    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 Generated Output

    The end result of using #if and #foreach with #forpage statement.

Glossary

  • VTL
    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:

Velocity template language

Velocity variable

Velocity Directives