hutool BigExcelWriter 下的autoSizeColumnAll异常问题

autoSizeColumnAll
java.lang.IllegalStateException: Could not auto-size column. Make sure the column was tracked prior to auto-sizing the column.

        SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
        //上面需要强转SXSSFSheet  不然没有trackAllColumnsForAutoSizing方法
        sheet.trackAllColumnsForAutoSizing();
        //列宽自适应
        writer.autoSizeColumnAll();
文章来自:https://www.cnblogs.com/singworld/p/12037138.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3