Projects:Process Definition Reports/TechnicalSpecs
Contents |
Process Defintion Reports - Technical Specs
Introduction
This project is delivered as a patch to be included in core. All the developments belong to core's module org.openbravo.client.application.
Application Dictionary
New Tab Reports based on new OBUIAPP_Report table.
Columns:
- PDF Template, to define the jrxml template to use when exporting to PDF
- XLS Template, to define the jrxml template to use when exporting to XLS
- Use PDF as XLS template. When the same template is used for both formats.
- Only the PDF Template must be set if this flag is checked.
This table has a unique constraint on obuiapp_process so each Process Definintion can only have 1 record.
The report definition must belong to the same module than the header. The sourcedata datasource has been modified accordingly and a trigger has been created to avoid modifications when the module is not in development.
New Files
BaseReportActionHandler.java
Generic Action Handler to be used for reports. It can be used on any report if no additional requirements are needed.
In case that a report needs to to additional validations or it is desired to send to the jasper report additional parameters not defined as filter parameters it is possible to extend this class. Extra validations can be done overriding the doValidations empty method. Extra parameters can be defined in the addAdditionalParameters method adding them to the parameters Map.
The print process is done in a static synchronize method preventing multiple executions in parallel.
The Report is printed in 2 calls to the server. On the first call the report is generated and the file is stored in the tmp folder in the Openbravo Source folder. The response JSONObject includes a responseActions object to call the OBUIAPP_downloadReport action with the name and path of the temporary file.
The OBUIAPP_downloadReport does a new call to the ActionHandler using the GlobalHiddenForm to download the file. Once the file is downloaded it is deleted from the temporary folder.
ReportingUtils
New java utils class. It implements all the logic to print a report with all the parameters values set in the Process Definition window.
ob-reporting-action.js
New js file to define the OBUIAPP_downloadReport action that it is called on the response of the main report print to download the generated file.
Modified Files
ob-parameter-window-view.js
It adds the definition of the Export to PDF and Export to XLS buttons and the logic to show them.
ob-parameter-window-view.js and ob-pick-and-execute-grid.js
Modify the logic to enable or disable the export buttons when all required parameters are set.
ob-pick-and-execute-view-window.js.ftl and ParameterWindowComponent.java
It adds new properties to OBParameterWindowView for the reports based on the Report that it is being loaded.