Home > Chapter 13 Reporting > Automatic Report Generation
Use Automatic Report Generation to create reports for multiple displays from the command line. You customize the report by modifying the report configuration file.
This section contains the following:
§ “Starting Automatic Report Generation” on page 972
§ “Customizing a Report” on page 973
Starting Automatic Report Generation
To start Automatic Report Generation, run the run_reportgen script in the directory where your RTView displays reside.
In an initialized command window (see “Initializing a Command Prompt or Terminal Window”):
1. Go to the directory where your displays reside.
type run_reportgen -report:<reportconfigfilename>
See demos/features/report.xml for a sample configuration file.
The report configuration file can contain multiple reports. Each report can contain multiple sections, each with a separate display that is output to a single PDF file.
The report configuration file is in XML, and must start with the following:
<?xml version="1.0" ?>
<rtvreport xmlns="www.sl.com" version="1.0">
The file must end with the following:
</rtvreport>
The following tags are supported:
Tag |
Description |
Attribute Name |
Attribute Description |
---|---|---|---|
report |
Specify a report definition. Your configuration file may contain multiple reports. |
name |
The name of the report. |
title |
The title for the report. This tag is optional. If specified, this title will be used instead of the display name in the header of each page in the report. |
||
section |
Specify the display and page setup information for this section. You may have multiple sections in a single report. |
display |
The name of the RTView display to use for this section. |
subs |
The substitution values to apply to the RTView display. Specify initial substitutions for this display. “Substitutions” are optional and must use the following syntax: $subname:subvalue $subname2:subvalue2 If a substitution value contains a single quote, it must be escaped using a / : $filter:Plant=/'Dallas/' If a substitution value contains a space, it must be enclosed in single quotes. Do not escape these single quotes: $subname:subvalue $subname2:'sub value 2' A substitution string cannot contain the following: : | . tab space , ; = < > ' " & / \ { } [ ] ( ) Note: Substitutions set in Application Options will apply to all displays. See “Substitutions Tab” for more information. |
||
timeout |
The time to wait (in seconds) for data sources to update before producing a report for this section. |
||
page_setup |
Specify the page setup options for this section. |
orientation |
The values are portrait or landscape. |
margin_left |
Sets the left margin. The values are in inches. |
||
margin_right |
Sets the right margin. The values are in inches. |
||
margin_top |
Sets the top margin. The values are in inches. |
||
margin_bottom |
Sets the bottom margin. The values are in inches. |
||
output |
Specify the output options for this report. |
filename |
The base name of the generated report file. A PDF suffix is added automatically. |
append_timestamp |
The values are none, date_time or date_only. If date_time, append timestamp to file basename in the form yearmonthday_hourminsec, where hour is on a 24 hour clock. For example, a report with a filename of myreport output September 15, 2006 at 8:45am would be named as follows: myreport_20060915_084500.pdf. If date_only, append the timestamp in the form yearmonthday. For example, a report with a filename of myreport output September 15, 2006 at any time would be named as follows: myreport_20060915.pdf. |
||
report_or_display |
The kind of report to generate. The values are display or report. display - With this option a screen capture of a display is exported. report - With this option a screen capture of a display is exported onto the first page followed by at least one page for each table or object grid in the display. As many pages as are necessary to show all the data in each table or object grid are included in the report. This enables you to view all data in a table or object grid that you otherwise must use a scrollbar to see. If there are no tables or object grids in your display, you will only get a screen shot of the display. |
Example report.xml File
<?xml version="1.0" ?>
<rtvreport xmlns="www.sl.com" version="1.0">
<report name = "report1">
<section display = "object_variety.rtv"
subs = ""
timeout = "0">
<page_setup orientation = "landscape"
margin_left = "1.0"
margin_right = "1.0"
margin_top = "1.0"
margin_bottom = "1.0">
</page_setup>
</section>
<section display = "object_variety2.rtv"
subs = ""
timeout = "0">
<page_setup orientation = "landscape"
margin_left = "1.0"
margin_right = "1.0"
margin_top = "1.0"
margin_bottom = "1.0">
</page_setup>
</section>
<output filename = "report1"
append_timestamp = "true"
report_or_display = "report">
</output>
</report>
<report name = "report2">
<section display = "object_variety3.rtv"
subs = "value1:value2 value3:value4"
timeout = "0">
<page_setup orientation = "landscape"
margin_left = "1.0"
margin_right = "1.0"
margin_top = "1.0"
margin_bottom = "1.0">
</page_setup>
</section>
<output filename = "report2"
append_timestamp = "true"
report_or_display = "report">
</output>
</report>
</rtvreport>