[alibaba/easyexcel]将数据写入Excel报NullPointerException

2024-05-24 564 views
6

日志开头提示如下: c.a.e.m.property.ExcelHeadProperty : The table has no header set and all annotations will not be read.If you want to use annotations, please use set head class in ExcelWriterBuilder/ExcelWriterSheetBuilder/ExcelWriterTableBuilder

我的版本是2.0..5

回答

5

ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX); writer.write(list, sheet1); 应该是执行这两行报错 writer和list、sheet1均不为空

2

请使用EasyExcel来构建ExcelWriter

0

就是 没有头class而已,问题不大,只是提示。升级到2.1.3已经删除了这个提示。