Example 2: Create the files required for a "Triggers" report template

Create the files to support the new "Triggers" report template. This template will include a repitition trigger.

About this task

You will create four files:

  • Template schema definition file: Triggers.rsd.
  • Report template file: Triggers.4rt.
  • Properties file: Triggers.4rt.prop.
  • Image file: Triggers.4rt.png.

Before you begin:

  • Ensure that you have a directory on your disk (for example, MyReportTemplates) to hold your report template files. You may need to configure Genero Studio to recognize the directory.
  • In Genero Studio, create the project (for example, MyTemplates.4pw) to hold the template files.
  1. Create a template schema definition file (File > New > Reports > Template Schema Definition (.rsd)) and enter the following text:
    <?xml version="1.0" encoding="utf-8"?>
    <ReportSchema fileVersion="30000" gstVersion="30000" rootElementName="model">
        <Trigger name="TheTrigger" minOccurs="0" maxOccurs="unbounded"/>
    </ReportSchema>

    Save the template schema definition file as Triggers.rsd in your report template directory.

    This code creates a single trigger.
  2. Create a report template file (File > New > Reports > Empty Report Template (.4rt)):
    1. In the Data View, click Open Schema File and select the Triggers.rsd schema.
    2. In the Report Structure, move the trigger under the Page Root.
    3. Add a Word Box as a child of the trigger, and edit the text to read "Repeat Me". The report template should look like Figure 1.
      Figure: Report template example

      This figure shows the layout of a report template, with report structure.

    Save the report template file as Triggers.4rt in your report template directory.

  3. Create a text file in the same directory as the template files. Save it as Triggers.4rt.prop and enter the following text:
    tags: Triggers
    label: Trigger Template
    description: Template with a single trigger
  4. Create an image file in the same directory as the template files. Save it as Triggers.4rt.png.
    Note: You can take a screen capture of the existing template, or copy an image from elsewhere.