Free Support Forum -

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 ( or I have the folowing exception :

com.sgcib.wasa.reporting.exception.WasaReportingException: java.lang.NullPointerException
at com.sgcib.wasa.reporting.service.ReportPostTradeProcessBusinessServiceImpl.processFile(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$
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(
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReportToStream(
at net.sf.jasperreports.engine.export.JRXlsAbstractExporter.exportReport(
at com.aspose.cells.jasperreports.ACXlsExporter.exportReport(Unknown Source)
at com.sgcib.wasa.reporting.service.ReportGenerationBusinessServiceImpl.export_XLS_ASPOSE(
at com.sgcib.wasa.reporting.service.ReportGenerationBusinessServiceImpl.exportReport(
at com.sgcib.wasa.reporting.service.ReportPostTradeProcessBusinessServiceImpl.processFile(
… 6 more

I cannot post my reports for confidentiality and copyright reasons.

It occurs on BAR CHARTS


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 “lib1” & “lib2” and copy jars in
SampleHsqlJavaProcessproject lib directorty

To test project run ProcessReportMock class with the following parameters :

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.


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

This issue has been logged as CELLSJSP-28641 .


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.


Never mind. Thanks for your testing and feedback.