Skip to content

Commit

Permalink
[代码优化](v2.6):修复导出 excel 数据报错
Browse files Browse the repository at this point in the history
  • Loading branch information
elunez committed Dec 12, 2020
1 parent 264b3cb commit 76b600e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eladmin-common/src/main/java/me/zhengjie/utils/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ private static void sizeChineseColumn(SXSSFSheet sheet, BigExcelWriter writer) {
SXSSFCell currentCell = currentRow.getCell(columnNum);
if (currentCell.getCellTypeEnum() == CellType.STRING) {
int length = currentCell.getStringCellValue().getBytes().length;
if (columnWidth < length) {
// 如果长度大于最大值 65280,那就取 length
if (columnWidth < length || (columnWidth * 256 > 65280)) {
columnWidth = length;
}
}
Expand Down

0 comments on commit 76b600e

Please sign in to comment.