The sample shows how to use reporting add-on in the CUBA Platform (requires premium package).
The application provides ReportingRestService,
which introduces the generateInvoice
method, implemented in ReportingRestServiceBean.
The method is exposed as a REST method via rest-services.xml.
The method programmatically generates the report with the code field equals to INVOICE_PDF. The report gets an instance of the Order entity as a parameter. The resulting report is stored in the File Storage and can be accessed later by the returned Id of its File Descriptor.
Useful links:
The Polymer client module contains a showcase of how to invoke ReportingRestService to generate a report and how to provide a link for downloading the result from the File Storage. See reportgeneration-generate-invoice-form.html component.
The application uses the zxing library to generate barcodes and QR codes. The application provides the service to generate QR codes. The [DOCX2PDF] Invoice report is using this service to include a QR code into the report.