Jump to content
We've recently updated our Privacy Statement, available here ×
  • Fixing potential issues with report book broken layout when exporting to DOCX


    prusyn
    • Features: Exporters Version: v7.3 Product: JasperReports® Library

    Issue:

    [toc on_off::hide=1]

    Customer made an example of a Book Report containing other 3 reports having a table component. It appears, being exported to DOCX, there are several issues obeserved:

    1.  Report1 and Report2 left border of all elements in the first column is not displayed and the bottom border when printing the word document it is deleted. The same problem when the report is execute as a stand alone report and not as part of the group
    2. There is the issue in Report2 that the cell doen't adjust in size when the report is executed as a book, and works just fine when it is execute as a stand alone report.
    3. Report 3 problem is that when the report is a part of the book, all the text even if it is set to Arial 6, are set as Arial 8. This problem is only visible if the book is executed, if the report is executed as a stand alone report it works fine.

    Also, PDF and Powerpoint export looks fine. Only DOCX seems to be corrupted. Reports and the book are attached.


    Resolution:

    1. Regarding the table borders problem, you need to set the property below in the Book.jrxml file.

    net.sf.jasperreports.export.docx.frames.as.nested.tables = false

    2. The problem with cell size adjustment can be fixed by setting the property below in the book.jrxml and also choosing top margin = 0, left margin = 0, bottom margin = 0 and right margin = 0 in the book.jrxml. All page margins should be 0 in this case.

    net.sf.jasperreports.export.docx.flexible.row.height = true

    These setting are only for book.jrxml

    3. The error with Report 3 appears to be a defect, which were submitted to our internal tracking system with ID JRL-1419. The problem happens because the same style name appears in several reports.  Therefore one workaround is to change the name of the Table_TD_Value style in Report3 to a name that's unique across the reports that are part of the book.

    book.jrxml

    report1_3.jrxml

    report2_0.jrxml

    report3.jrxml


    User Feedback

    Recommended Comments

    I want to export the DOCX file

    when i use  JRDocxExporter , the  file will have dashed lines

    JasperReport jasperDesign = JasperCompileManager.compileReport(fileName); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperDesign, null, new JREmptyDataSource()); JRDocxExporter jrDocxExporter = new JRDocxExporter(); jrDocxExporter.setExporterInput(new SimpleExporterInput(jasperPrint)); jrDocxExporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outFile + "1" + ".docx")); jrDocxExporter.exportReport();

    https://szyy.notion.site/Dashed-Line-ed68826523174f949bb846bb2f556a15

     

    I have set the property: net.sf.jasperreports.export.docx.frames.as.nested.tables = false 

    ---------

    This is my first time using JasperReport.   

    Perhaps this is a very simple question.

    But I really really really need helps 

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...