NullPointerException with Aspose JasperReports 2.7.1

Hi,


I upgraded from Aspose JasperReports 2.5.0 to 2.7.1 and a NullPointerException occurs when i export a report.

No error with the same report with version 2.5.0

I attached the .jrprint (zip archive) to this post.

Thank you for your inverstigation

Here’s the stack trace :
java.lang.NullPointerException
at awjr.awjr8.awjr6.a(Unknown Source)
at awjr.awjr9.awjr17.asX(Unknown Source)
at awjr.awjr9.awjr17.asD(Unknown Source)
at awjr.awjr9.awjr7.e(Unknown Source)
at awjr.awjr9.awjr6.b(Unknown Source)
at awjr.awjr9.awjr6.m(Unknown Source)
at awjr.awjr9.awjr4.asn(Unknown Source)
at awjr.awjr9.awjr4.asm(Unknown Source)
at awjr.awjr9.awjr2.asg(Unknown Source)
at awjr.awjr9.awjr2.b(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.m(Unknown Source)
at awjr.awjr9.awjr4.asn(Unknown Source)
at awjr.awjr9.awjr4.asm(Unknown Source)
at awjr.awjr9.awjr2.asg(Unknown Source)
at awjr.awjr9.awjr2.b(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.m(Unknown Source)
at awjr.awjr9.awjr4.asn(Unknown Source)
at awjr.awjr9.awjr4.asm(Unknown Source)
at awjr.awjr9.awjr2.asg(Unknown Source)
at awjr.awjr9.awjr2.b(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.m(Unknown Source)
at awjr.awjr9.awjr4.asn(Unknown Source)
at awjr.awjr9.awjr4.asm(Unknown Source)
at awjr.awjr9.awjr2.asg(Unknown Source)
at awjr.awjr9.awjr2.b(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.m(Unknown Source)
at awjr.awjr9.awjr4.asn(Unknown Source)
at awjr.awjr9.awjr4.asm(Unknown Source)
at awjr.awjr9.awjr2.asg(Unknown Source)
at awjr.awjr9.awjr2.b(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at awjr.awjr9.awjr6.a(Unknown Source)
at com.aspose.words.jasperreports.AWAbstractExporter.a(Unknown Source)
at com.aspose.words.jasperreports.AWAbstractExporter.exportReport(Unknown Source)
Hi Jerome,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for JasperReports 2.7.1 and have not found the shared issue. Please make sure that you are using Aspose.Words for JasperReports 2.7.1 and same .Jrprint file. We have attached the output Docx with this post for your kind reference.

Hi,


Sorry, i have attached only the first .jrprint of the list.

Here’s the whole list of .jrPrint attached to the zip archive (outputs.zip)

Thank You

The Aspose JasperReports version used is 2.7.1
Hi Jerome,

Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJSP-181. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSJSP-181) have been fixed in this Aspose.Words for JasperReports 2.7.2 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,


I have just upgraded Aspose JasperReports to 2.7.2, the NullPointerException is gone, but a blank page appears inside the exported dcument.
No issue with the native JR exporter with the same report.

I attached the jrprint list and the docx output to the post : jrprintList.zip

Thank you
Hi Jerome,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJSP-182. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Jerome,

I am developer who works on this issue right now.
Could you please try to set following config option in your code:

exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.1);
Please let us know whether it fixed the issue.

You can read more about this option here - Spacing Factor


Thanks and regards,
Vadim

Hi,


With :

<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold; font-style: italic;”>SPACING_FACTOR<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>0.1<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>–> <span style=“font-family: “Courier New”; background-color: rgb(255, 255, 255);”>no more blank page, but the report is not exported properly (the spacing is bad : see attached output)

For info, here’s the parameters i used for Aspose exporters :

<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.RECOGNIZE_FIELDS, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>true<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_SECTIONS);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.EXPORT_RECTANGLES, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>true<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.EXPORT_LINES, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>true<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>true<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.USE_EXACT_SPACINGS, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>true<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.EXPORT_EMPTY_TEXTS, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>false<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“color: rgb(102, 14, 122); font-family: “Courier New”; font-size: 12px; font-weight: bold;”>exporter.setParameter(AWExporterParameter.EXPORT_REPEATING_ELEMENTS, true);
<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(102, 14, 122); font-weight: bold;”>exporter<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>.setParameter(AWExporterParameter.PAGE_MARGINS, <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 255);”>…<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>);
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>
<span style=“font-family: “Courier New”; background-color: rgb(255, 255, 255);”>Thank you
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>
<span style=“font-family: “Courier New”; font-size: 9pt; background-color: rgb(255, 255, 255);”>

Hi Jerome,

Thanks for additional info.

Please let us know also:
1) what version of Office do you use?
2) do you see [Compatibility Mode] on top of Word window while opening generated report?
3) exact value of PAGE_MARGINS option

Thanks,
Vadim

Hi,


1) Office 2010
2) Yes
3) 2.0cm;2.0cm;2.0cm;2.0cm;

I also tried :

exporter.setParameter(AWExporterParameter.DOCX_COMPATIBILITY, 2010);

with 2007, 2010, 2013 but i always see [Compatibility Mode] on top of Word window, and the export is still the same (bad spacing)

Thanks



Hi Jerome,

Thanks for sharing the detail. We have logged this information in our issue tracking system. We will inform you via this forum thread once there is any update available on this issue. We apologize for your inconvenience.

Hi Jerome,

I almost done with improving logic for positioning tables.
Seems all works fine except one page only - need to slightly decrease bottom margin.
So is it possible to change bottom margin as follows - “2.0cm;2.0cm;2.0cm;1.5cm;” ?

>but i always see [Compatibility Mode] on top of Word window
Thanks for letting know, we will work on this also.


Thanks,
Vadim

Hi,


>So is it possible to change bottom margin as follows - “2.0cm;2.0cm;2.0cm;1.5cm;” ?

In fact, custumers may customize their templates and customize the margins. So we can’t hard coded margins


Thanks
Hi Jerome,

Thanks for sharing the detail. We will inform you via this forum thread once there is any update available on this issue.
Hi Jerome,

Thanks for your patience. The issue (WORDSJSP-182) has been resolved in Aspose.Words for JasperReports 2.7.3.

Please note that USE_POSITIONING_TABLES and SPACING_FACTOR configuration options are not required for this issue.

The issues you have found earlier (filed as WORDSJSP-182) have been fixed in this Aspose.Words for JasperReports 2.7.3 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Hi Jerome,

Regarding compatibility mode issue, we have logged this problem in our issue tracking system as WORDSJSP-184. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,


Thanks for the new release 2.7.3 !

The issue seems to be resolved (no NPE, no blank page) when i 'm not using USE_POSITIONING_TABLES parameter.

Indeed, if i use USE_POSITIONING_TABLES with SMART, there’s still have some issues : page breaks, blank pages, bad borders table rendering.

With ALWAYS, it’s worse.

So, i will not use this parameter.

Thank You

Hi Jerome,

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please note that USE_POSITIONING_TABLES is not required for shared issue.

Please let us know if you have any more queries.