[alibaba/easyexcel]读取记录时提示The content of an excel record cannot

2024-05-09 860 views
2

原因是POI限制了字节数8224,因为xls文件微软官方也做了限制,但是实际文件出现了这个问题,有没有什么办法可以绕过? 异常代码

   EasyExcel.read(fis).sheet().doReadSync();
   ExcelReader excelReader = EasyExcel.read(fis).registerReadListener(listener).build();
   List<ReadSheet> sheets = excelReader.excelExecutor().sheetList();

异常提示 Exception in thread "main" org.apache.poi.util.RecordFormatException: The content of an excel record cannot exceed 8224 bytes at org.apache.poi.hssf.record.RecordInputStream.nextRecord(RecordInputStream.java:230) at org.apache.poi.hssf.record.RecordFactoryInputStream.nextRecord(RecordFactoryInputStream.java:253) at org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:168) at org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:129) at org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processWorkbookEvents(HSSFEventFactory.java:80) at org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processWorkbookEvents(HSSFEventFactory.java:53) at com.alibaba.excel.analysis.v03.XlsSaxAnalyser.execute(XlsSaxAnalyser.java:136) at com.alibaba.excel.analysis.ExcelAnalyserImpl.analysis(ExcelAnalyserImpl.java:124) at com.alibaba.excel.ExcelReader.read(ExcelReader.java:63) at com.alibaba.excel.ExcelReader.read(ExcelReader.java:53) at com.alibaba.excel.read.builder.ExcelReaderSheetBuilder.doReadSync(ExcelReaderSheetBuilder.java:80) 建议描述

回答

9

这个需要提供下文件

1

不知道您是否已经解决该问题?我们先暂时关闭这个问题,如果还存在问题请重新Reopen这个issue

4

我也遇到了这个问题,我有个xls文件在一台FTP服务器上,用的是Windows Server 2012系统,我的应用程序在一台Linux上,用的是easyExcel最新的依赖,奇怪的是这个文件放在本地读取没有出现这个问题

4

1685414030084 1685414076911