Jump to content
  • A3 not supported in xls export


    hozawa
    Assigned User shertage
    CategoryBug report
    PriorityImmediate
    ReproducibilityAlways
    ResolutionFixed
    SeverityCritical
    StatusClosed
    Versionv6.2

    Can not export A3 report in xls format.

     

    There is following comment in JRXlsExporter.java class but it seems to be outdated:

    // Compare to ISO 216 A-Series (A3-A5). All other ISO 216 formats

    // not supported by POI Api yet.

    // A3 papersize also not supported by POI Api yet.

     

    Class HSSFPrintSetup inherits PrintSetup that has A3_PAPERSIZE so A3 should be allowed.

    https://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFPrintSetup.html

     



    User Feedback

    Recommended Comments

    FYI, this only involves the followings in JRXlsExporter.java file.

    private final short getSuitablePaperSize()

     

    1. Change loop to include A3

    Before:

    for (int i = 4; i < 6; i++)

     

    After:

    for (int i = 3; i < 6; i++)

     

    2. Add following condition

    Before:

    if (i == 4)

    {

    ps = HSSFPrintSetup.A4_PAPERSIZE;

    }

     

    After:

    if (i == 3)

    {

    ps = PrintSetup.A3_PAPERSIZE;

    }

    else if (i == 4)

    {

    ps = HSSFPrintSetup.A4_PAPERSIZE;

    }

     

    I actually just changed this if statement to switch:

    switch(i)

    {

    case 3:

    ps = PrintSetup.A3_PAPERSIZE;

    break;

    case 4:

    ps = HSSFPrintSetup.A4_PAPERSIZE;

    break;

    case 5:

    ps = HSSFPrintSetup.A5_PAPERSIZE;

    break;

    }

    break;

     

     

    3. Add import

    import org.apache.poi.ss.usermodel.PrintSetup;

    Link to comment
    Share on other sites

    Changed Priority from Normal to Immediate

    Changed Severity from Minor to Critical


    Is there any other way to do that without changing the JRXlsExporter.java? It's JRXlsExporter.class file in my case.So I can't manipulate this file. Pls help anyone. Is there any latest jar which supports this feature?
    Link to comment
    Share on other sites


×
×
  • Create New...