Example 1: Create the files required for a "Users" report template

Create the files to support the new "Users" report template. The template involves a report design with two variables: a string field and a numeric field.

About this task

You will create four files:

  • Report template schema definition file: Users.rsd.
  • Report template file: Users.4rt.
  • Properties file: Users.4rt.prop.
  • Image file: Users.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">
        <Field name="StringUserName" type="string" sampleValue="John Doe"/>
        <Field name="NumericUserID" type="double" sampleValue="1234"/>
        <Trigger name="requiredButNotUsed" minOccurs="0" maxOccurs="unbounded"/>
    </ReportSchema>
    Note:

    The trigger is required for the template to work, but it is not used in this template.

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

    This code creates two fields:
    • StringUserName of type String with a default value of John Doe.
    • NumericUserID of type Double with a default value of 1234.
  2. Create a report template file (File > New > Reports > Empty Report Template (.4rt)):
    1. In the Data View, open the Users.rsd schema.
    2. Drag and drop the StringUserName and the NumericUserID fields from the Data View to the work area.
      A Word Wrap Box and a Decimal Format Box are created, using the appropriate class and data.
    3. Add Word Boxes and edit the text to provide labels. 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 Users.4rt in your report template directory.

  3. Create a text file in the same directory as the template files. Save it as Users.4rt.prop and enter the following text:
    tags: Users
    label: User Name and ID
    description: Template with two fields
  4. Create an image file in the same directory as the template files. Save it as Users.4rt.png.
    Note:

    You can take a screen capture of the existing template, or copy an image from elsewhere.

  5. Select Tools > Specific Setup > Reload.