|
JasperProcess |
|
|
The JasperProcess element prepares the inputs of the JasperReports reporting engine in the runtime and calls it to generate reports in PDF, Text, Excel (xls or csv) and RTF formats.
Properties Connection Name (Accepts MScript) The name of the JDBC connection defined with "mor > RelDB > RelDBConnection" element in Common Definitions file. The JasperProcess uses this connection to obtain the data for the report. Report File Name (Accepts MScript) The name of a report file (either with jrxml or jasper extension) that exist under the JasperReport Files folder should be given. Examples: The SQL query that access to the data base through the JDBC connection specified with Connection Name property retrieves the data to fill in the report. The SQL defined in this property overrides the SQL of the report template which was defined when preparing the template with iReport tool. Using the MScript functions embedded in the SQL makes it possible to form the dynamic queries. For example a request parameter called cat_id can be used in the query as follows:
Report parameters (Accepts MScript) Any number of report parameters that are required by the report template can be defined in this property. Each parameter must be defined on a separate line in The PARAM_NAME is the name of the report parameter and the PARAM_VALUE should be an MScript expression. JasperProcess Parameter Examples:
Sub-Report Connection Parameters (Accepts MScript) The defining this property is meaningful if the report has sub reports and one or more sub-reports use a jdbc connection different than the master report's connection. There must be a report parameter with the same name in the JasperReports report and its class must be "java.sql.Connection". The value of the parameter must be the name of a "RelDBConnection" element configured in the Common Definitions page. JasperProcess Sub-Report Connection Parameter Examples:
Explanations: There must be two report parameters with name SUBREP_CONN_DERBY and SUBREP_CONN_ORACLE in the JarperResports report and their classes should be "java.sql.Connection". There must be two connection definitions with name 'Derby' and 'Oracle' that was defined with "mor > RelDB > RelDBConnection" element on the Common Definitions page.
Output Type (Accepts MScript) This property defines the format of the output document. The supported formats are: 1. PDF, 2. Text, 3. Excel (xls), 4. Excel (csv), 5. RTF. Only the number before the "." character is significant for defining the type. Should this value be defined dynamically with MScript the the resolved value must be a number between 1 and 5. Example:
Otherwise JasperProcess throws an Exception.
Output File Name (Accepts MScript) The name of the output document file. It can be the name of either a permanent or a temporary file. Note that the temporary files are created under {WEB_APPLICATION_ROOT}/WEB-INF/MM-INF/~tempfiles directory and the names of the files are stored in pool variables or in process record fields. MoreMotion constantly scans the temporary files under this folder and deletes the expired files.
Examples:
Sub Reports JasperReports supports Master-Detail reports through sub-reports. A sub-report receives its parameters from the master report and lists the inner records accordingly. Unlike the master report files that can be provided either as jrxml or jasper files, sub-report files can only be provided in jasper format. A report parameter called "SUBREPORT_DIR" should be defined in the master report file and the name of the sub-report should be specified as The JasperProcess sets the value of this parameter as {WEB_APPLICATION_ROOT}/WEB-INF/MM-INF/jasper-reports/ in the runtime. The Summary:
|