https://issues.apache.org/bugzilla/show_bug.cgi?id=55872
Bug ID: 55872
Summary: ColumnGroupCollapsed and autoSizeColumn don't work
together
Product: POI
Version: 3.9
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: SXSSF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 31109
--> https://issues.apache.org/bugzilla/attachment.cgi?id=31109&action=edit
Excel document. Top: with sheet.autoSizeColumn(4); Bottom: without
sheet.autoSizeColumn(4);
Apache POI Version: 3.9 (20121203)
Java Version: 1.6.0_26
Hi,
if I execute the following code the Excel-Document does not fulfil my
expectations (see attachment):
SXSSFWorkbook wb = new SXSSFWorkbook( 100000 );
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
for(int i=0; i < 10; i++) {
row.createCell(i).setCellValue("Some content");
}
sheet.autoSizeColumn(2);
sheet.autoSizeColumn(3);
//sheet.autoSizeColumn(4); // with this, it works!
sheet.groupColumn(2, 3);
sheet.setColumnGroupCollapsed(2, true);
try {
File file = File.createTempFile("output", ".xlsx");
wb.write(new FileOutputStream(file));
System.out.println(file.getAbsolutePath());
} catch (Exception ex) {}
The excel document is right, when I uncomment this line:
sheet.autoSizeColumn(4);
I've tried to set the default column width with
sheet.setDefaultColumnWidth(20);
but it has no effect.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]