1、easyexcel依赖包版本
<!-- alibaba easyexcel依赖包 -->
<!-- https://mvnrepository.com/artifact/com.alibaba/easyexcel -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>1.1.2-beta4</version>
</dependency>
异常信息
java.lang.IllegalArgumentException: The maximum length of cell contents (text) is 32,767 characters\n\tat org.apache.poi.xssf.streaming.SXSSFCell.setCellValue(SXSSFCell.java:325)\n\tat com.alibaba.excel.util.WorkBookUtil.createCell(WorkBookUtil.java:69)\n\tat com.alibaba.excel.write.ExcelBuilderImpl.addBasicTypeToExcel(ExcelBuilderImpl.java:102)\n\tat com.alibaba.excel.write.ExcelBuilderImpl.addOneRowOfDataToExcel(ExcelBuilderImpl.java:125)\n\tat com.alibaba.excel.write.ExcelBuilderImpl.addContent(ExcelBuilderImpl.java:63)\n\tat com.alibaba.excel.write.ExcelBuilderImpl.addContent(ExcelBuilderImpl.java:70)\n\tat com.alibaba.excel.ExcelWriter.write1(ExcelWriter.java:106)\n\tat
2、异常分析
public void setCellValue(RichTextString value) {
XSSFRichTextString xvalue = (XSSFRichTextString)value;
if (xvalue != null && xvalue.getString() != null) {
this.ensureRichTextStringType();
if (xvalue.length() > SpreadsheetVersion.EXCEL2007.getMaxTextLength()) {
throw new IllegalArgumentException("The maximum length of cell contents (text) is 32,767 characters");
}
if (xvalue.hasFormatting()) {
logger.log(5, new Object[]{"SXSSF doesn't support Shared Strings, rich text formatting information has be lost"});
}
((SXSSFCell.RichTextValue)this._value).setValue(xvalue);
} else {
this.setCellType(CellType.BLANK);
}
}
从目前分析来看,2007版本的cell设计是不超过32,767
3、github提问
文件导出时,单元格内容长度过长时,抛出The maximum length of cell contents (text) is 32,767 characters