Created attachment 31109 [details] 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.
Can you try version 3.10-beta2? http://search.maven.org/#artifactdetails|org.apache.poi|poi|3.10-beta2|jar I believe your issue has the same roots as https://issues.apache.org/bugzilla/show_bug.cgi?id=52186. That problem should be fixed as of version 3.10-beta2.
Thank you vladk, it is fixed in 3.10-beta2.