Line Break issue: Jasper Reports

@tahir.manzoor

Hi Tahir. I continue to work with DOCX exporter and the bug WORDSJR-216 still reproduced.
We use parameter “net.sf.jasperreports.export.pdf.force.linebreak.policy=true” for PDF exporter.
And I want to get the same result in DOCX. How should i handle that parameter for DOCX exporter to get similar result? I’ve used the latest version of “Aspose.Words for JasperReports 17.6” library with and without provided parameter AWExporterParameter.TRIM_OVERSIZED_TEXTS and haven’t got the same result as in PDF.
Thanks for your time.

@Igor_Filler

Thanks for your inquiry. We will appreciate it if you please ZIP and attach your input/output documents (jrxml/pdf/rtf/docx files) and source code here for testing. We will investigate the issue on our end and provide you more information.

Best regards,

Hi Tilal, I’ve attached .jrprint ; expected result in PDF format and generated result in DOCX. As you can see at PDF first row is : “Report Title abc:” , on the other hand at DOCX just “Report Title” and “abc:” has transferred to the next row.

Additional options, that you should set to get similar results:
net.sf.jasperreports.default.font.name=Courier New
net.sf.jasperreports.default.font.size=8
net.sf.jasperreports.default.pdf.font.name=Courier
net.sf.jasperreports.export.pdf.force.linebreak.policy=true

Please, let me know if you get any difficulties.

WORDSJR-216.zip (20.0 KB)

@Igor_Filler

Thanks for sharing the additional information. I have tested the scenario and noticed the reported issue. I have logged a ticket WORDSJR-221 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress withing this forum thread.

We are sorry for the inconvenience.

Best Regards,

@Igor_Filler

Thanks for your patience. We have started the investigation, please share some details how you are setting net.sf.jasperreports.export.pdf.force.linebreak.policy=true, as your shared document ‘output.jrprint’ does not contain properties.

Please note TRIM_OVERSIZED_TEXTS parameter is not required for this particular case. It should be used to forcibly cut off long texts. But we need to insert line breaks without cutting text.
Furthermore, in order to check new logic it is also possible to force line breaks using config option,
exporter.setParameter(AWExporterParameter.FORCE_LINE_BREAKS, true). Sample output is attached for your reference.Out_AW_176.zip (5.4 KB)

You would have been already considering these points but just for update, always check whether old JAR-file is removed from /WEB-INF/lib after copying new one and restart jasper server after copying new JAR-file.

Looking forward to your feedback.

Best Regards,

@tilal.ahmad

Hi Tilal, thank you for quick response. Actually it was my question.

We use jasperreports.properties where we define all desired properties for PDF. JasperExportManager works fine, and question was how to use new logic at Aspose for Jasper 17.6 to handle net.sf.jasperreports.export.pdf.force.linebreak.policy=true for DOCX.

I couldn’t find any information about how actually fixed WORDSJR-216. Also i haven’t found any information about exporter.setParameter(AWExporterParameter.FORCE_LINE_BREAKS, true) before you said at last post.
I’ve checked this pages looking for solution:

Release notes only mentioned TRIM_OVERSIZED_TEXTS option. Please, could you point a right place with information relative to this functionality.
I’ve tried to download attached Out_AW_176.zip and got HTTP ERROR 500.

I checked exporter with FORCE_LINE_BREAKS option and now all works fine.
Thank you a lot.

Best regards

@Igor_Filler

Thanks for your feedback and sorry for your inconvenience due to missing information. It is good to know that you have managed to resolve the issue. However, we will update the documentation for same as well and will try our best to avoid such confusion in future.

Please feel free to contact us for any further assistance.

Best Regards,