Example 3: Create the files required for an "Items" report template

Create the files to support the new "Items" report template. The template will include template field triggers and a template field.

About this task

You will create four files:

  • Template schema definition file: Items.rsd.
  • Report template file: Items.4rt.
  • Properties file: Items.4rt.prop.
  • Image file: Items.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">
        <TemplateFieldsTrigger groupName="items"/>
        <TemplateFieldsTrigger groupName="items"/>
        <TemplateFieldsTrigger groupName="moreItems"/>
        <Trigger name="requiredButNotUsed" minOccurs="0" maxOccurs="unbounded"/>
    Note: The trigger is required for the template to work, but in this case is not used.

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

    For every named group, a template trigger (shown as a blue dot) is created in the template report structure. In this example, three template triggers are created (two for "items" and one for "moreItems"). If you want to include the same data twice (for example, adding the titles to the heading and the data to the list), you must create two groups with the same name.

    For every uniquely named group, a tab is created in the New Report from Template wizard. In this example, two tabs are created: for "items" and "moreItems".

  2. Create a report template file (File > New > Reports > Empty Report Template (.4rt)):
    1. In the Data View, open the Items.rsd schema.
    2. Add a Horizontal Box (Mini Page), a Word Box, and two Template Fields. In the Report Structure, move the items to 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 Items.4rt in your report template directory.

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