[Bug 64811] New: autoSizeColumn too small if cell contains special characters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64811] New: autoSizeColumn too small if cell contains special characters

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64811

            Bug ID: 64811
           Summary: autoSizeColumn too small if cell contains special
                    characters
           Product: POI
           Version: 4.1.2-FINAL
          Hardware: PC
            Status: NEW
          Severity: minor
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 37499
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37499&action=edit
Screenshot Excel 2016 (Windows 10)

I am facing a problem, when using autoSizeColumn and an arrow character
(U+279D) appears in cell content, the column will be sized too small.
This code will produce a file containing the problem:

@Test
void excelColWidthStreamedTest() throws IOException {
        final SXSSFWorkbook wb = new SXSSFWorkbook(null, 5000, false, true);
        SXSSFSheet listSheet = wb.createSheet("List");
        listSheet.trackAllColumnsForAutoSizing();

        Row headerRow = listSheet.createRow(0);
        headerRow.createCell(0).setCellValue("MyLongLongString ➝");
        headerRow.createCell(1).setCellValue("➝ MyLongLongString");
        headerRow.createCell(2).setCellValue("My➝Long➝Long➝String");
        headerRow.createCell(3).setCellValue("MyShortString");

        for (int i = 0; i < 4; i++) {
                listSheet.autoSizeColumn(i);
        }
        File excelFile = new File("testFileStreamed.xlsx");
        try (OutputStream fileOut = new FileOutputStream(excelFile)) {
                wb.write(fileOut);
        }
}

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64811] autoSizeColumn too small if cell contains special characters

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64811

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64811] autoSizeColumn too small if cell contains special characters

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64811

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <[hidden email]> ---
When running this locally on Linux Ubuntu 20.04, the width of the cells is
fine, so it may be related to the fonts that are installed on the system where
you run the auto-size operation (OS rendering functionality is used to draw the
actual characters of the Font of the cell).

Please verify if default fonts and some basic X-window libraries are installed
as those might be needed for proper execution of the auto-sizing functionality.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]