Wrong page breaking

Hi,

I’m posting this to report a problem which I think I already reported in the past.

Attached to this thread you’ll find an archive containing the following:

\-two.doc files generated from our application using Aspose.Words
for JasperReports\ - corresponding.jrprint files

- corresponding .jrxml templates

The problem is that the page breaking is wrong, for example, in document Report_mod_2_2_1.doc there shouldn’t be the first page break, which creates an almost empty page, and the same happens in the document Report_mod_5_6.doc

This are just two examples, but there are other documents generated by our software which present the same problem.

Would it be possible to fix this and have correct page breaking throughout the documents?

Thanks in advance.

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.

This issue is marked as solved, but I still see it in latest Aspose.Words for JasperReports v1.8.0

` mtassinari:
This issue is marked as solved, but I still see it in latest Aspose.Words for JasperReports v1 .8 .0 *\

As a proof of concept of what I am saying, I have attached an example.zip file which contains

  • a result .doc file
  • a .jrprint file
  • the templates

In the .doc, you will notice that:

  • the table structure is wrong, when a line goes on another table, not all cells have the same height
  • the content of the cells of column 2 is partially hidden, like it was somehow compressed in the space of the cell

Is it possible to solve this issue?

I have attached another example.

In this case, the document is actually created by using Aspose.Words for Java to merge together two templates filled using Aspose.Words for JasperReports.

The two templates are called “intro” and “99_7_mod_2”, for which I included the .jrxml template and the resulting .jrprint

Now “intro”, which is the first 3 pages of the resulting .doc and contains header and footer, shows no problem, while problems start with “99_7_mod_2”, in fact you can see, for example:

- there is a page break at page 5, which is plain wrong
- another wrong page break at page 7
- page layout completely screwed at page 8
- the text in the table cells is somewhat compressed and the last line is hard to read

I would like to underline that, while the wrong page breaking was present in older versions of Aspose.Words for JasperReports, the problem of compressed text never showed up before upgrading to latest version.

I would appreciate some feedback about this problem ASAP because, as you might as well imagine, this is quite a big bug for us.

Hi Matteo,

Thanks for your inquiry. Please set AWDocExporter page break parameter (AWExporterParameter.PAGE_BREAKS) before saving Jrxml into Doc file format. Please read the following documentation link for your kind reference. Hope this helps you.
https://docs.aspose.com/words/jasperreports/page-breaks/

If the problem still remains, please attach the jrxml along with XML or CSV data source here for testing. I will investigate the issue on my side and provide you more information.

I think that option will not help me, even worse, it would mess up all other reports should I change it, in fact in many templates I have manually positioned some page breaks which would get ignored should I change that option.

The problem here is not the page breaks I manually place, but rather those automatically placed by the library.

I’ll try the option nonetheless, and provide you with some input CSV.

tahir.manzoor:
If the problem still remains, please attach the jrxml along with XML or CSV data source here for testing. I will investigate the issue on my side and provide you more information.

I have attached to dataset relative to my “example2” archive, “99_7_mod_2” report. Please note that the first row contains column names.

Inside that report template, you can ignore the following subreports 'cause they’re not actually used: 0, 1, 2, 6, 7, 8

EDIT: I also attached the result of trying to set the PAGE_BREAK option to PAGE_BREAK_NONE, as you see the layout is still wrong, with the addition now that where I WANT a page break to be put, there is none!

Hi Matteo,

Thanks for sharing the jrxml/jrprint files. I am unable to execute your jrprint files by using Aspose.Words. Could you please share which version of Jasper Report and iReport version you are using? I am using jasperreports-4.5.1 version.

I have managed to reproduce this issue by using JasperExportManager.exportReportToPdfFile method. In output Pdf file, the page breaks are correct. However, in shared output Doc file the page breaks are incorrect.

To reproduce page break issue at our end by using Aspose.Words, please simplify your jrxml file which describes the page break issue and share it here for testing purposes.

tahir.manzoor:
Could you please share which version of Jasper Report and iReport version you are using? I am using jasperreports-4.5.1 version.

I am using JasperReports 5.1 with iReport 4.5 .1

tahir.manzoor:
To reproduce page break issue at our end by using Aspose.Words, please simplify your jrxml file which describes the page break issue and share it here for testing purposes.*

I cannot simplify the test case more than this, 'cause our document is that complex, and we need it to be so.

If you want to try end simplify a bit, use only the sub reports 3, 4 and 5, together with the .csv file I already shared as a data source. That should be the minimal setup to reproduce the issue.

Hi Matteo,

Please accept my apologies for late response. I will setup JasperReports 5.1 at my side and will test your scenario as soon as possible.

Thanks for your patience and understanding.

Hi Matteo,

Thanks for your patience. I have logged this issue as WORDSJSP-111 in our issue tracking system. 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.

tahir.manzoor:
I have logged this issue as ** WORDSJSP - 111 ** in our issue tracking system.

Does this mean that you have been able to reproduce the issue? Should you need more test cases, please ask, I have plenty of them…

Hi Matteo,

Thanks for your inquiry. Yes, I managed to reproduce the same issue at my side. Please see the attached image for detail. We will update you via this forum thread once this issue is resolved.

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

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

aspose.notifier:
The issues you have found earlier (filed as WORDSJSP-111) have been fixed in this Aspose.Words for JasperReports 17.3.0 update.*

I was testing the latest version using the new library and a temporary license, and I can say that the problem with page break has not yet been solved, I see no improvement especially with heavy tabular data.

Hi Matteo,

Thanks for your inquiry.

mtassinari:
-the text in the table cells is somewhat compressed and the last line is hard to read *

Please set the value of USE_EXACT_ROW_HEIGHTS as Boolean.FALSE to fix this issue.

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

mtassinari:
-page layout completely screwed at page 8 *

This issue has been fixed in latest version of Aspose.Words for JasperReports 17.3.0.

mtassinari:
-there is a page break at page 5, which is plain wrong
-another wrong page break at page 7

Please use the value of SPACING_FACTOR less than 1 e.g. .9 to fix such issues. We suggest you please use following export parameters to get the correct output. Hope this helps you.

exporter.setParameter(AWExporterParameter.USE_EXACT_ROW_HEIGHTS, Boolean.FALSE);
exporter.setParameter(AWExporterParameter.SPACING_FACTOR, .9);
exporter.setParameter(AWExporterParameter.PAGE_BREAKS, AWExporterParameter.PAGE_BREAKS_NONE);