Jump to content
  • Incorrect styles.xml for xlxs export


    mmgeza
    Assigned User teodord
    CategoryBug report
    PriorityNormal
    ReproducibilityAlways
    ResolutionFixed
    SeverityMajor
    StatusClosed
    When exporting into xlsx with jasperreports 4.1.3, and opening the generated file with OpenOffice/LibreOffice, none of the styles are applied (no borders, missing font and background colors, font names and sizes, no number formats). However, the same file appears correctly, with all styles applied in MS Office.


    User Feedback

    Recommended Comments

    The missing attributes on xf tags in styles.xml also seem to be preventing autosizecolumn via apache POI. To duplicate, export to xlsx via jasper and try to autosize a column via apache POI (tried with POI version 3.6 and 3.8-beta). Then open the same xlsx file in MS Excel, save the file, and try to autosize columns via POI, will work.
    Link to comment
    Share on other sites

    Hi,

     

    This is a pretty good catch! Thanks!

    I have now fixed it by adding applyAlignment and applyProtection too.

     

    Nathan,

     

    I'm not sure what you mean by POI. What does POI have to do with the XLSX export? How exactly are you using this stuff?

     

    Thanks,

    Teodor

     

    Link to comment
    Share on other sites

    Teodor,

     

    I'm using Jasper to export xlsx files, no issues there. Then I use Apache POI to do some post-processing on the xlsx files to fill in some gaps on things Jasper doesn't yet offer (setting print options such as scale factor, landscape mode, etc.).

     

    When I try to use Apache POI to autosize some columns on Jasper generated xlsx output, I get null pointer exceptions that seem to be related the missing styles.xml data.

     

    I've got trunk checked out, will see if this fixes the issue.

     

    Thanks for the prompt reply.

    Link to comment
    Share on other sites


×
×
  • Create New...