소소한 개발팁

apply apache poi autoSizeColumn

roynus 2019. 10. 14. 18:06

SXSSFWorkbook wb = new SXSSFWorkbook();

SXSSFSheet sheet = wb.createSheet(); // do not Sheet......    use SXSSFSheet

then, you can set

sheet.trackAllColumnsForAutoSizing();

after set all data, you can fit all column size automatically through for loop or while

sheet.autoSizeColumn(columnIndex);