Grid Report Generation Process
The following steps outline the grid report generation process.
-
Triggering a grid report:
-
The user performs the search in the relevant application.
Note: Only production or proposal jobs are returned from a search for financial reports.
-
The user selects no, some or all of the rows in the search results grid.
-
The user selects the Export To Report option on the grid to display the Export to Report dialog box.
-
The user selects the report template, with the report templates in the drop-down selection list being set by preference for the related grid. Note that any report template, where the template's Report Type is 00—Grid can be entered directly into the field.
-
The user can optionally email the report that is created. The default EmailTo address is presented and can be changed or cleared, as required.
-
The user can optionally print the report that is created. The device denoted by the report template's Device Code, or an application or generic device is presented, and can be changed or cleared, as required.
-
The user can optionally specify to download the report after it is generated. If Download is cleared, then typically it is printed or emailed.
-
-
Grid report generation:
-
The report generation is executed by the system batch processor.
-
Various report scripts are accessed, such that, at each hook point in the generation process, the related event in the script is run:
-
The script linked from the report template
-
The script linked from the REPORT_SCRIPT application preference, if that preference exists and is active
-
For a validation report, the script linked from the VALIDATION_REPORT_SCRIPT application preference, if that preference exists and is active.
-
-
The core object-based result set is determined from the type of grid and the application or service that it supports and is then passed to the report engine. Refer to the list of grid report result sets supplied with CCLAS, which changes according to the type of grid.
-
The core result set is populated as follows:
-
If no search is already performed, or the criteria changed an no search performed on the changed criteria, then the core result set is populated base on the search criteria (not possible via the user interface but may be possible via script), otherwise
-
If a search is performed but no rows are selected, then the result set contains all records that match the criteria, even if the records are not downloaded to the client as yet, or
-
If a search is performed and one or more rows are selected, then the result set contains only the selected records.
-
A resource field definition (RFD) file is used to limit the fields included within the core result sets, so that the report result sets are kept as small as possible.
Note: For a financial report, where the client's Invoice Sample Details is selected, then sample details are included in the invoice report set, and where cleared, then sample details are NOT included in the invoice report set.
-
-
If the template is a ZIP file that contains a DSC (direct source connection) file, then it is used to create additional result sets for the report, including database fields, logo images and text notes. Parameters are passed into the DSC. Where no rows are selected in the grid, then the inputs to the DSC include the search criteria, in which case, the DSC needs to locate the results that match the search criteria. Where rows are selected in the grid, then the inputs to the DSC include the specific selected records.
and the DSC result sets are populated. The inputs to the DSC include the specific records selected from the grid, or the search criteria (in which case the DSC needs to also locate the results that match the search criteria).
Note: A DSC file can be embedded with the following report engines: Crystal Reports, Chunk Text, and Other—Groovy. If a DSC file is used, it needs to be zipped with the report template and the ZIP file uploaded to CCLAS using the CCTPLR—Report Template application. Where the ZIP file includes more than one DSC file, the first randomly found one is used—therefore it is best to have only one DSC file in the ZIP file.
-
The language of the grid report is determined from the grid report configuration. Data is extracted based upon the report language in place.
-
The onInitialiseDataSource event function in each applicable script is run. Generally, this event function is used to define and populate additional results sets or to adjust the core result sets (that is, the default result sets and DSC-derived result sets), and to allow all of these result sets to be passed to a non-core report engine (for example, SSRS—SQL Server Reporting Services).
-
Both the core and DSC-based result sets, the report template, and the output format requirements, are packaged and sent to the report engine for report generation.
-
The report template is read to determine the expected grid report result sets. Where the expected core object-based result set (Grid Report Data Sources) matches the core object-based result passed from the application, then the template uses it. Where another referenced results sets match one created by the DSC, then the template uses it. The report generation returns an error if the report template references a result set that is not passed from the application or created by the DSC.
-
The result sets are used to populate the report template to create the report document.
-
The onGenerated event function in each applicable script is run. Generally, this event function is used to change properties of the report document or save the report in an alternate format, or pass the report document to services for report authentication (for example, by applying a digital signature).
-
The report document is closed and the report engine returns the output file. The report filename is constructed by the report template's Output File Name or Output File Name Syntax.
-
The report generation process ends.
-
Report distribution takes place, if requested.
-
The onClose event function in each applicable script is run. Generally, this event function is used to update the CCREPORT object.
-
If an error is raised during the execution of each applicable script, the onError event function is run. This event function is used for error management.
-
The report is generated and passed back to the user for downloading, if requested.
-
A report entity is created in the report repository (CCREPORT table, accessed by the CCREPT—Report application) and given a Report Type of Grid.
-
Regardless of the report engine in use, the report generation process is essentially the same.
Setting Report Templates, Printing and Emailing Details
Templates, printing and emailing details are defined based on the type of grid. The following application preferences, specified using the CCPREF—Preference application, impact THE report generation.
| Grid | Application Preferences | Use |
|---|---|---|
| All generic search result grids (except the CCSTRP—Job Status Report Search and CCFNRP—Financial Report Search grids which are managed specially) | SEARCH_REPORT_ApplicationName | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| SEARCH_REPORT_DEVICE | The Export To Report dialog's Default Report Printing Device (unless a device is defined in the report template's Device. | |
| SEARCH_REPORT_EMAIL_TO | The Export To Report dialog's Default Email Address to where to email the generated report. | |
| SEARCH_REPORT_EMAIL_MESSAGE_TEXT | The code of the syntax used to construct the Email Message text. If the preference is absent or a syntax with a matching code is not found, then a default message text is inserted: "Laboratory Management Report". | |
| SEARCH_REPORT_EMAIL_SUBJECT_TEXT | The code of the syntax used to construct the Email Subject text. If the preference is absent or a syntax with a matching code is not found, then a default subject text is inserted: "See attached report, generated by CCLAS". | |
| REPORT_FROM_EMAIL_ADDRESS | The from email address. | |
| CCSTRP—Job Status Report Search search results grid | SEARCH_REPORT_CCSTRP | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| STATUS_REPORT_DEVICE | The Export To Report dialog's Default Report Printing Device (unless a device is defined in the report template's Device. | |
| STATUS_REPORT_EMAIL_TO | The Export To Report dialog's Default Email Address to where to email the generated report. | |
| STATUS_REPORT_EMAIL_SUBJECT_TEXT | The code of the syntax used to construct the Email Message text. If the preference is absent or a syntax with a matching code is not found, then a default message text is inserted: "Laboratory Management Report". | |
| STATUS_REPORT_EMAIL_MESSAGE_TEXT | The code of the syntax used to construct the Email Subject text. If the preference is absent or a syntax with a matching code is not found, then a default subject text is inserted: "See attached report, generated by CCLAS". | |
| CCFNRP—Financial Report Search search results grid | SEARCH_REPORT_CCFNRP |
The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. Note: The report template's Report Type must be Financial (not Grid) for financial reports. |
| FINANCIAL_REPORT_DEVICE | The Export To Report dialog's Default Report Printing Device (unless a device is defined in the report template's Device. | |
| FINANCIAL_REPORT_EMAIL_TO | The Export To Report dialog's Default Email Address to where to email the generated report. | |
| FINANCIAL_REPORT_EMAIL_SUBJECT_TEXT | The code of the syntax used to construct the Email Message text. If the preference is absent or a syntax with a matching code is not found, then a default message text is inserted: "Laboratory Management Report". | |
| FINANCIAL_REPORT_EMAIL_MESSAGE_TEXT | The code of the syntax used to construct the Email Subject text. If the preference is absent or a syntax with a matching code is not found, then a default subject text is inserted: "See attached report, generated by CCLAS". | |
| CCREGNSAMP—Update Sample search results grid |
|
The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCSPFNSCHANASRCH—Specification Scheme Analyte Search search results grid |
|
The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
|
CCBTCH—Update Batch Sample grid |
SEARCH_REPORT_CCBTCHSAMP | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCBTCH—Update Batch Scheme grid | SEARCH_REPORT_CCBTCHSCH | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCBTCH—Update Batch Scheme Analyte grid | SEARCH_REPORT_CCBTCHSCHANA | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCVALN—Update Validation Sample search grid |
|
|
| CCQUOTE—Quote Search search results grid | SEARCH_REPORT_CCQUOTE | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCCLNT—Update Client Quote grid | SEARCH_REPORT_CCCLIENTQUOTE | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCPRCCAT—Update Price Catalogue Price Book Schedules grid | SEARCH_REPORT_CCPRCBKSCHD | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
|
CCQHS—Update QC History discrete results for blanks grid
|
SEARCH_REPORT_CCQCHS_CONTAMINATION | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCQCHS—QC History Discrete results for standards and spikes grid | SEARCH_REPORT_CCQCHS_ACCURACY | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCQCHS—QC History Discrete results for duplicates and replicates grid | SEARCH_REPORT_CCQCHS_PRECISION | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCJAUD—Job Audit search results grid | SEARCH_REPORT_CCJAUD_GROUP | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
| CCJAUD—Update Job Audit detail grid | SEARCH_REPORT_CCJAUD_DETAIL | The list of available grid report templates, comprised as a comma-separated list of report template codes and report descriptions in the format <ReportTemplateCode>:<GridReportDescription>. |
