Jump to content
Changes to the Jaspersoft community edition download ×

Error on Report generation with multiple groups.


ahegde

Recommended Posts

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!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

You need to either provide us with the report template and the data to be able to reproduce the problem locally, or you could give us the *.jrprint object (report prior to export). or the generated report exported to XML format using the JRXmlExporter.

You could also try a more recent version of JR yourself, to see if the problem has dissappeared.

 

Thanks,

Teodor

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...