We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NullPointerException while using the AWDocxExporter

Hi!

We want to to convert to using Aspose for exporting Word documents. I have downloaded a trial version and imported it into our project but I can not get it to work.

My code looks like this:

JRExporter exporter = new AWDocxExporter();
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.75);
exporter.setParameter(AWExporterParameter.OVERLAP_RESOLUTION_METHOD, AWExporterParameter. OVERLAP_RESOLUTION_METHOD_PUSH_ITEMS);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, output);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, filename.toString());
exporter.exportReport();

But when running this code I get the following stacktrace:

2014-06-17 14:46:56,022 [btpool0-12] ERROR se.excito.ecm.report.ECMLogger - java.lang.NullPointerException
at net.sf.jasperreports.engine.JRAbstractExporter.getCurrentItemConfiguration(JRAbstractExporter.java:578)
at net.sf.jasperreports.engine.JRAbstractExporter.setOffset(JRAbstractExporter.java:470)
at net.sf.jasperreports.engine.JRAbstractExporter.setOffset(JRAbstractExporter.java:460)
at com.aspose.words.jasperreports.AWAbstractExporter.exportReport(Unknown Source)

What can be the problem? Using other exporters in JasperReports works fine, the problem is only with Aspose.

Thanks,

Mikael


Hi Mikael,

Thanks for your inquiry. Could you please attach following files for testing? I will investigate the issue on my side and provide you more information.

  • Please supply us with the Jrxml files along with xml/csv data source
  • Please supply us with the .jrprint file of your jrxml
As soon as you get these pieces of information to us we'll start our investigation into your issue.

Hi!

Thanks for the reply. I have attached the files you asked for. I had to zip the jrxml file since the forum software did not allow attachments with suffix .jrxml


Never mind this issue. I found the cause of my problem. I was using the most recent version of JasperReports (5.6.0). This version does not seem to work with Aspose.Words.

I downgraded to JasperReports version 5.5.0 and then the export started working.

Hi Mikael,

Thanks for sharing the detail. It is nice to hear from you that you have found the solution of your issue.

However, I have managed to reproduce the same issue using JasperReports (5.6.0) at my side. For the sake of correction, I have logged this problem in
our issue tracking system as WORDSJSP-144. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hello,


What is the status of this issue? It has been reported in June, and so far it seems that it is still not resolved?

We have been a happy customer of Aspose Cells for Java for several years, this blocking issue is preventing us from purchasing the Jasper Reports emitter for Word… We cannot downgrade to an earlier version of Jasper Reports.

Thanks in advance,

Barry

Hi Barry,

Thanks for your inquiry. I have already answered your query here in this post. Please follow that thread for further proceedings.