Is it possible to autoSizeColumns on a streaming SXSSFWorkbook? I implemented an export functionality to export a list of objects to excel. At first I used the XSSFWorkbook
Error: NullPointerException on org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:122)
org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:122)
Fix: Always set value to Cell as shown below, it throws NullPointerException when there is null in Cell, so set the value as:
Cell c = row.createCell(i); c.setCellValue(text == null ? "" : text );