I have designed a report using Jasper version 3.0.0. The report uses 2 groups in the design. On a prticular size of the data I face the following problems: 1. The pdf is generated with an extra blank page at the end 2. The excel report generation fails with the following exception
Caused by: java.lang.NegativeArraySizeException at net.sf.jasperreports.engine.export.JRGridLayout.layoutGrid(JRGridLayout.java:299) at net.sf.jasperreports.engine.export.JRGridLayout.<init>(JRGridLayout.java:144) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:454) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:434) at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:218)
After digging around the jasper code, I realized that the jasperprint object that we create to pass as an argument to the JasperExportManager.exportReportToPdfFile for pdf generation has a property called getPages(). I realized that the getPages().size() [used elsewhere in the code] gave a value of 21. In the actual generated pdf file we have 20 pages of data and the last page blank with only the page header and footer.
I mention that we have 2 groups in the report intentionally. I realized that when there is more than 1 group present, the way the calculation of space required for the group footer is done may be incorrect specially in the 2 cases: 1. The values of both the groups changes 2. The end of the report is reached, so we have to put in a group footer.
Request the technical support team to please advise on whether this is a know issue and if yes, whether later version of jasper has a fix for this.
Error on Report generation with multiple groups.
in Products
Posted
Hi,
I have designed a report using Jasper version 3.0.0.
The report uses 2 groups in the design. On a prticular size of the data I face the following problems:
1. The pdf is generated with an extra blank page at the end
2. The excel report generation fails with the following exception
Caused by: java.lang.NegativeArraySizeException
at net.sf.jasperreports.engine.export.JRGridLayout.layoutGrid(JRGridLayout.java:299)
at net.sf.jasperreports.engine.export.JRGridLayout.<init>(JRGridLayout.java:144)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:454)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:434)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:218)
After digging around the jasper code, I realized that the jasperprint object that we create to pass as an argument to the
JasperExportManager.exportReportToPdfFile for pdf generation has a property called getPages(). I realized that the
getPages().size() [used elsewhere in the code] gave a value of 21. In the actual generated pdf file we have 20 pages of data and the last page blank with only the page header and footer.
I mention that we have 2 groups in the report intentionally. I realized that when there is more than 1 group present, the way the
calculation of space required for the group footer is done may be incorrect specially in the 2 cases:
1. The values of both the groups changes
2. The end of the report is reached, so we have to put in a group footer.
Request the technical support team to please advise on whether this is a know issue and if yes, whether later version of jasper
has a fix for this.
Thanks!