码迷,mamicode.com
首页 > 其他好文 > 详细

hutool BigExcelWriter 下的autoSizeColumnAll异常问题

时间:2019-12-13 21:38:32      阅读:675      评论:0      收藏:0      [点我收藏+]

标签:LLC   exception   not   nsf   sheet   nal   could not   was   could   

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();

hutool BigExcelWriter 下的autoSizeColumnAll异常问题

标签:LLC   exception   not   nsf   sheet   nal   could not   was   could   

原文地址:https://www.cnblogs.com/singworld/p/12037138.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!