Generating PDFs with JasperReport
This is to add support to generate reports on the server using JasperReports.
One Jasper report will receive one GG-CE "root entity". Let's take OrderRequest
as an example.
The Jasper report file/code will be stored in the file repository in path reports/OrderRequest
with name packinglist.???
. The admin may upload additional report "templates" to this folder or update existing ones.
API updates
- Extend
CRUDController
with GET /report/list to get the list of report templates stored in the file repository for this entity. The method returnsList<RepositoryFile>
. - Extend
CRUDController
with POST /report/generate/{reportTemplate} that receives the name of the Jasper report (in file repository) and a set of entityLong id
s from the client. The service will load the list of entities (in a read-only transaction) and return the PDF generated by Jasper for the provided entities.