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

Free Support Forum - aspose.com

Wrong page numbers in exported DOCX document

Hello,

I have exported a report, with the Aspose.Words exporter for JasperReports, in the docx format.

In the generated report the page numbers a wrong:

On the page one the page number is wrong 1/2.
On the page two the page number is wrong 1/2.
On the page three the page number is wrong 2/2.

I have added a zip file contains the jrprint-file, the docx-file with wrong page numbers and the pdf-file with right page numbers.

The report is exported as follow:

AWDocxExporter exporter = new AWDocxExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outputFileName);
exporter.setParameter(AWExporterParameter.EXPORT_LINES, true);
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.90);
exporter.exportReport();

Why the page numbers are wrong?

Thanks.

BR

libero

Hi

Thanks for your inquiry. Your request has been logged in our defect database. The developer, who is responsible for Aspose.Words for JasperReports will answer you shortly.

Best regards.

Hello,

any news about this?

Thanks.

BR

libero

Hi

Thanks for your request. Unfortunately, there is still no news about this issue. We will keep you informed and let you know once the issue is fixed.

I apologize for inconvenience.

Best regards,

Hi Libero,

Thanks for your inquiry. Unfortunately, the issue is still unresolved. At the moment this issue is pending for analysis and is in the queue. The responsible developer will analyze the issue and we will then be able to provide you more information. We apologize for your inconvenience.

Best Regards,

Hello,

any news about this?

Thanks.

BR

libero

Hi

Thanks for your inquiry. Unfortunately, your issues are pending for analysis. Once our developers analyze these issues, we will be able to provide you an estimate. You will be notify as soon as it is fixed. Sorry for inconvenience.

Hello,

any news about this?
(No response for over a year.)

Thanks.

BR

libero

Hi libero,

Thanks for your inquiry. I have verified the status of WORDSJSP-71 from our issue tracking system and like to share with you that this issue has been resolved. Please try the latest version of Aspose.Words for JasperReports 1.10.0 from here:
https://downloads.aspose.com/words/jasperreports

Please use the AWExporterParameter.USE_EXACT_ROW_HEIGHTS in your code to fix this issue.
AWExporterParameter.USE_EXACT_ROW_HEIGHTS is
TRUE by default so height of rows will be exactly when .jrprint file is
exported to Doc/Docx file format by using latest version of
Aspose.Words for JasperReports.

Please let us know if you have any more queries.

Hello Tahir Manzoor,

I am pleased to hear that the bug is fixed.

Is this new version of “Aspose.Words for JasperReports 1.10.0” license technically covered by us or is something else to do it here?

Thank you for your efforts.

libero

Hello Tahir Manzoor,

I have downloaded the new version “Aspose.Words for JasperReports 1.10.0” but I cann’t find the AWExporterParameter.USE_EXACT_ROW_HEIGHTS in this version.

The error still occurs.

Best regards,

libero.

Hi libero,

Thanks for your inquiry. Please make sure that you are using the latest version of Aspose.Words for JasperReports 1.10.0. Following code example shows how to use AWExporterParameter.USE_EXACT_ROW_HEIGHTS.

AWDocxExporter exporter = new
AWDocxExporter();

exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, Boolean.FALSE);

exporter.exportReport();

Hello Tahir Manzoor,

thanks for your quick reply.

I have tested the new version with the bug fix as described.
But I have to say that the bug still occurs.

I have added a zip file contains the jrprint-file, the docx-file with
wrong page numbers and the pdf-file with right page numbers.

The report is exported as follow:

AWDocxExporter exporter = new AWDocxExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outputFileName);
exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, Boolean.FALSE);
exporter.exportReport();

Thanks.

BR,

libero

Hi libero,

Thanks for your inquiry.

I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSJSP-134. 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,

any news?

Thanks.

Hi libero,

Thanks for your inquiry.

I suggest you please use the additional configuration option (AWExporterParameter.SPACING_FACTOR) with value 0.0 to fix this issue. Please try this configuration option and let us know how it goes on your side. Hope this helps you. Please let us know if you still face any issue.

AWDocxExporter exporter = new AWDocxExporter();
exporter.setParameter(JRExporterParameter.INPUT_FILE_NAME, "c:\\Aspose_Error.jrprint");
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "c:\\Out.Docx");
exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, Boolean.FALSE);
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.0);
exporter.exportReport();

Hello Tahir Manzoor,

thanks for your quick reply.

I have tested your proposal as described.
But the bug still occurs.
I have added my generated “Out.Docx”.

Were you able to create the “Out.Docx” without errors?

P.S.:
When I use the new “aspose.words.jasperreports.jar” and export without the new settings (AWExporterParameter.USE_EXACT_ROW_HEIGHTS and AWExporterParameter.SPACING_FACTOR) I get the best result. Could the error until now no longer produce.

What about the license for the new jar?

Thank you for your efforts.

Libero

Hi libero,

libero:

*I have tested your proposal as described.
But the bug still occurs.
I have added my generated “Out.Docx”.

Were you able to create the “Out.Docx” without errors?*

Thanks for sharing the output document. I have not found any issue in shared Out.docx. There is no empty pages in Out.docx.

I have retested the scenario with following code example by using Aspose.Words for JasperReports 1.10.0 and have found one empty page in Out.docx. Please check the page number 11 of attached Out.docx.

AWDocxExporter exporter = new AWDocxExporter();
exporter.setParameter(JRExporterParameter.INPUT_FILE_NAME, "c:\\Aspose_Error.jrprint");
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "c:\\Out.Docx");
exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, Boolean.FALSE);
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, 0.0);
exporter.exportReport();

Moreover, I have verified the status of WORDSJSP-134 from our issue tracking system and like to share with you that this issue has been closed without a fix. The AWExporterParameter.SPACING_FACTOR additional configuration option fix this issue.

However, I have found one empty page in output docx. I am in communication with the development team about this issue and will update you as soon as I have information on this.

libero:

When I use the new “aspose.words.jasperreports.jar” and export without the new settings (AWExporterParameter.USE_EXACT_ROW_HEIGHTS and AWExporterParameter.SPACING_FACTOR) I get the best result. Could the error until now no longer produce.

Could you please share the export parameters which you have used to export your .jrprint file?

libero:

What about the license for the new jar?

Please check the expiration date of
your license file. To check an expiration date of your license, please
open the license file using notepad. You will see the following tags:

20140618

It means that you can free upgrade to version of Aspose.Words published before 06/18/2014.

If you need to update to the latest version of Aspose.Words for JasperReports, but your license does not allow you to update to this version, you should contact Aspose sales team to renew your license.
https://forum.aspose.com/c/purchase/6

Hello Tahir Manzoor,

thanks for your quick reply.

tahir.manzoor :
Thanks for sharing the output document. I have not found any issue in shared Out.docx. There is no empty
pages in Out.docx.

In my shared “Out.docx” is the same error as you described below.
Also there are twice the term “page 10/11” (at the bottom of the page) . (see Screenshot.png)
This is still the main error and in my opinion the error is still not resolved.

To complete the task, I would like to include a current licensed version of “Aspose.Words.JasperReports” in our project and investigate further.
Would it be possible to get a new version (including license) from you?

Thank you for your efforts.

Best regards,
libero

Hi libero,

Thanks for your inquiry. The fix version of this issue is Aspose.Words for JasperReports 1.11.0 which will be released by the end of this month (around December’ 31, 2013). This issue might be resolved with the fix of some other/internal issues.

However, I am in communication with the development team about the fix of this issue and will update you as soon as I have information on this. Thanks for your patience.

libero:

Would it be possible to get a new version (including license) from you?

The next version of Aspose.Words for JasperReports will be available by the end of this month (around December’ 31, 2013). However, you should contact Aspose sales team to renew your license from here:
https://forum.aspose.com/c/purchase/6