1. 程式人生 > >linux導出Excel The maximum column width for an individual cell is 255 characters

linux導出Excel The maximum column width for an individual cell is 255 characters

class exce 方案 linu excel cnblogs cte for char

linux環境到處Excel報錯: The maximum column width for an individual cell is 255 characters

解決方案:

for (int i = 0; i < headerList.size(); i++) {  
            int colWidth = sheet.getColumnWidth(i)*2;
            if(colWidth<255*256){
                sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth);    
            }else{
                sheet.setColumnWidth(i,6000
); } }

linux導出Excel The maximum column width for an individual cell is 255 characters