Null pointer exception when export jasperPrint

I have a maser report containing sub report in which there are charts using a specific dataset (not the data source of the report). In some case I can have no data for the chart.

Jasper fill report work fine. Exporting XLS POI is ok.
When trying to export with Aspose Cells for Jasper reports (2.0.1.1 or 1.1.1.1) I have the folowing exception :

com.sgcib.wasa.reporting.exception.WasaReportingException: java.lang.NullPointerException
at com.sgcib.wasa.reporting.service.ReportPostTradeProcessBusinessServiceImpl.processFile(ReportPostTradeProcessBusinessServiceImpl.java:302)
at com.sgcib.ged.car.gui.analytics.service.ReportPostTradeBusinessService.generateReport(ReportPostTradeBusinessService.java:163)
at com.sgcib.ged.car.gui.analytics.view.panel.report.components.command.impl.PostTradeReportExcelFormatCommand.asynchCommand(PostTradeReportExcelFormatCommand.java:136)
at com.sgcib.ged.car.gui.analytics.view.panel.report.components.command.api.AbstractAsynchronousCommand$AsynchronousExecuteCommand.run(AbstractAsynchronousCommand.java:57)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.aspose.cells.jasperreports.CategoryChartConverter.getCategoryDataset(Unknown Source)
at com.aspose.cells.jasperreports.BarChartConverter.convert(Unknown Source)
at com.aspose.cells.jasperreports.ACXlsExporter.exportImage(Unknown Source)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportPage(JRXlsAbstractExporter.java:753)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(JRXlsAbstractExporter.java:578)
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(JRXlsAbstractExporter.java:320)
at com.aspose.cells.jasperreports.ACXlsExporter.exportReport(Unknown Source)
at com.sgcib.wasa.reporting.service.ReportGenerationBusinessServiceImpl.export_XLS_ASPOSE(ReportGenerationBusinessServiceImpl.java:222)
at com.sgcib.wasa.reporting.service.ReportGenerationBusinessServiceImpl.exportReport(ReportGenerationBusinessServiceImpl.java:75)
at com.sgcib.wasa.reporting.service.ReportPostTradeProcessBusinessServiceImpl.processFile(ReportPostTradeProcessBusinessServiceImpl.java:282)
… 6 more


I cannot post my reports for confidentiality and copyright reasons.

It occurs on BAR CHARTS

Hi,

Kindly do send your sample report file, e.g *.jrxml report file, output file etc. You may create a dummy report file and post us here to show the issue. We will check it soon.

Thank you.

I will do a sample as soon as possible.

The problem occurs when data source is empty (thing that can happen when no data have been retreived). I only tested Bar Chart. You should may be check other types of charts (pie, scater…).
Problem occurs on version 2.0… and earlier versions.

I give a sample in attachment.
Unzip"SampleHsqlJavaProcess"
Unzip “lib1” & “lib2” and copy jars in
SampleHsqlJavaProcessproject lib directorty

To test project run ProcessReportMock class with the following parameters :
…path\SampleHsqlJavaProcess<br>xls_aspose


I use Aspose Cells 2.0… version which is not available on download…
This version have been made to improve performance on export generation
(Benchmark between Aspose & POI). You shoud maybe set this version
available for download.

Hi,

Thanks for your providing *.jrxml file. I have logged this bug in our database.

This issue has been logged as CELLSJSP-28641 .

Hi,


Please try the attached fix, we have resolved your issue now.

Thank you.

Thanks. I’ll test it in the new days, once I have time in my projet.

Tested ok. It works… Thanks for the correction. You can deliver it.
Sorry to have been late to test : I had a lot of work.

Hi,

Never mind. Thanks for your testing and feedback.