Report and ReportData parts
Report and ReportData parts are predefined, which means that EGL
defines fields within the parts for you. You simply declare variables
based on the parts. You must initialize those variables before you
use them, so either create them with the new operator,
or use a set-values block in the declaration. The latter is more efficient.
See "new operator" and "Set-values blocks." The following example
shows Report and ReportData declarations:
myReport Report{};
myReportData ReportData{};A variable based on a Report part automatically contains the following
fields:
- reportDesignFile
- Full path to the report design file, which is a compiled XML file
with a .jasper extension.
- Type: STRING
- Example:
myRpt.reportDesignFile = "C:\\EGL\\reports\\customerDesignFile.jasper"; - Default: None
- reportDestinationFile
- Full path to the intermediate .jrprint file.
- Type: STRING
- Example:
myRpt.reportDestinationFile = "C:\\EGL\\reports\\customerPrintFile.jrprint";; - Default: None
- reportExportFile
- Full path to the final .xml, .pdf, .html, .txt., or .csv file.
- Type: STRING
- Example:
myRpt.reportExportFile = "C:\\EGL\\reports\\customerReport.pdf"; - Default: None
- reportData
- Reference to the actual data for the report.
- Type: ReportData
- Example:
myRpt.reportData = myReportData; - Default: None
You can establish initial values for these fields in a set-values block, as you can with properties; however, you can access and change those values at run time, which you cannot do with properties. See "Set-values blocks."
When specifying a path, you must prefix the directory separator
character with an escape character, (\), as in the following example:
myRpt.reportDesignFile = "C:\\EGL\\reports\\customerDesignFile.jasper";The report variable contains information specific to a report.
The variable contains these fields:
| Field | Description | Data type |
|---|---|---|
| reportDesignFile | Full path to the report design file, which is a compiled XML file with a .jasper extension | STRING |
| reportDestinationFile | Full path to the intermediate .jrprint file | STRING |
| reportExportFile | Full path to the final.xml, .pdf, .html, .txt., or .csv file | STRING |
| reportData | Reference to the actual data for the report | ReportData |
The report data variable describes the data to be used in a report.
The variable contains these fields:
| Field | Explanation | Data type |
|---|---|---|
| connectionName | Alias for a database connection that provides data for the report (DataSource.databaseConnection) | STRING |
| sqlStatement | The SQL statement that provides data to the report (DataSource.sqlStatement) | STRING |
| Data | Reference to a dynamic array of records (DataSource.reportData) | ANY |