GenerateReport command options

The GenerateReport command creates report design files (.4rp) based on a predefined template and schema.

Table 1. GenerateReport options
Option Description
-help or -h Displays a usage text and then exits.
-schemaFileName
Important: Mandatory option.
Specifies an XML schema file (.xsd) describing the data source of the report.
-rootElementName
Important: Mandatory option.
Specifies the expected document root in the XML schema file.

For example, if the schema specifies the elements "invoice" and "invoice-batch", then rootElementName would be set to "invoice" if the report will be run against a source that produces documents whose root element is of type "invoice".

-triggerMapping
Important: Mandatory option.
Specifies the mapping between the element names in the XML schema file and the trigger names in the design template.
The map syntax is as follows:
map: map-item (',' map-item)*
map-item: '{' element-name ',' trigger-name '}'
As an example, consider a report template designed against the schema defined by SimpleListTEmplate.rsd.
Note: Report template schema definition (.rsd) files are located in GREDIR/templates.
The schema defines the mappable triggers "outerGroups", "innerGroups" and "rows", where each is a descendant of its predecessor. If the input schema defines the elements "ProductGroups", "Areas", "Orders" and "Items", then the following are valid maps:
{ProductGroups,outerGroups},{Areas,innerGroups},{Items,rows}
{ProductGroups,outerGroups},{Orders,innerGroups},{Items,rows}
{ProductGroups,outerGroups},{Orders,rows}
{ProductGroups,rows}
{Orders,rows}
The following example mappings are invalid because they violate the ancestry:
{ProductGroups,innerGroup},{Areas,outerGroups},{Items,rows}
{Orders,outerGroups},{ProductGroups,rows}
-placeholderMapping Specifies the mapping between fields names in the design template and expressions of the same type that may be composed using fields from the XML schema file. Specifying this value is mandatory if the template contains references to fields.
Note: All placeholder values in placeholderMapping can either be constant values or RTL expressions enclosed in curly braces.
The map syntax is as follows:
StringMap:         MapEntry (',' MapEntry)*
MapEntry:          '{' Key ',' Value? '}'    
Key:               IdentifierStartChar IdentifierFollowChar* 
Value:            '"' StringToken* '"'
StringToken:       [^"\]
           |       EscapedQuote
           |       EscapedBackslash
           |       ExtraEscapes
EscapedQuote:      '\' '"'
EscapedBackslash: '\' '\'
ExtraEscapes:      '\' 'n'
            |      '\' 'r'
            |      '\' 't'
This means that encoders need to perform the following operations on all characters in the input strings:
  • Replace '\' by '\' '\'
  • Replace '"' by '\' '"'
  • Replace '\n' by '\' 'n'
  • Replace '\r' by '\' 'r'
  • Replace '\t' by '\' 't'
As an example, consider a report template that contains:
  • the string field "groupTitle", mapped to the RTL expression "Customer: "+orderline.orders.user_id"
  • the field "reportTitle", mapped to the constant string "Customer list"
  • the placeholder "optionalSubtitle", set to null

In this example, the placeholder mapping would be:

-placeholderMapping {groupTitle,"{{\"Customer: \"+orderline.orders.user_id}}"},
  {reportTitle,"Customer list"},{optionalSubtitle,}

This assigns the RTL expression '"Customer:"+orderline.orders.user_id' to the placeholder "groupTitle", the constant string "Customer list" to the placeholder "reportTitle", and the value null to the placeholder "optionalSubtitle".

Note: For clarity, no quoting was done to protect the string against shell expansion.
-templateFileName Specifies the name of the template (a '.4rp' or '.4rt' file) used as the base. If this parameter is not specified, then a default list template is used. The default template is designed against the schema of the SimpleListTemplate.rsd.
Note: Report template schema definition (.rsd) files are located in GREDIR/templates.
-fieldNamePatterns Specifies a selection of fields from the XML schema file that are to be used in the resulting report.

The expected syntax is a comma-separated list of field name patterns, which may contain the wildcard characters "*" and "?". The expression can be prefixed with an optional name followed by a colon. This name denotes a specific field trigger to cater to templates with multiple field lists.

As an example, consider a report that has the field triggers "outerGroupFields" and "rowFields". We would like to see the fields product_id and product_description on the group, and all fields from the record order_details in the rows. We would specify two fieldNamePatterns as follows:

-fieldNamePatterns outerGroupFields:product_id,product_description

-fieldNamePatterns rowFields:order_details.*

-outputFileName
Important: Mandatory option.
Specifies the name of the resulting .4rp file.
-debuglevel level Sets the debug level to the specified integer level. The debug level controls the level of verbosity of GRE components during execution. Higher values increase verbosity. By default, the value is set to 0 (no debugging output).
-stdin Instructs the program to read the command line arguments from stdin. The list of arguments needs to be terminated by an empty line. In this case, all other regular command line arguments are ignored.