We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
建议先去看文档 快速开始 、常见问题 触发场景描述 最后一行的cellMap实际上并没有值,但是并不为空,见debug截图
触发Bug的代码
public class RowTagHandler extends AbstractXlsxTagHandler { @Override public void startElement(XlsxReadContext xlsxReadContext, String name, Attributes attributes) { XlsxReadSheetHolder xlsxReadSheetHolder = xlsxReadContext.xlsxReadSheetHolder(); int rowIndex = PositionUtils.getRowByRowTagt(attributes.getValue(ExcelXmlConstants.ATTRIBUTE_R), xlsxReadSheetHolder.getRowIndex()); Integer lastRowIndex = xlsxReadContext.readSheetHolder().getRowIndex(); while (lastRowIndex + 1 < rowIndex) { xlsxReadContext.readRowHolder(new ReadRowHolder(lastRowIndex + 1, RowTypeEnum.EMPTY, xlsxReadSheetHolder.getGlobalConfiguration(), new LinkedHashMap<Integer, Cell>())); xlsxReadContext.analysisEventProcessor().endRow(xlsxReadContext); xlsxReadSheetHolder.setColumnIndex(null); xlsxReadSheetHolder.setCellMap(new LinkedHashMap<Integer, Cell>()); lastRowIndex++; } xlsxReadSheetHolder.setRowIndex(rowIndex); } @Override public void endElement(XlsxReadContext xlsxReadContext, String name) { XlsxReadSheetHolder xlsxReadSheetHolder = xlsxReadContext.xlsxReadSheetHolder(); // ###################这里判断EMPTY还是DATA不严谨 RowTypeEnum rowType = MapUtils.isEmpty(xlsxReadSheetHolder.getCellMap()) ? RowTypeEnum.EMPTY : RowTypeEnum.DATA; xlsxReadContext.readRowHolder(new ReadRowHolder(xlsxReadSheetHolder.getRowIndex(), rowType, xlsxReadSheetHolder.getGlobalConfiguration(), xlsxReadSheetHolder.getCellMap())); xlsxReadContext.analysisEventProcessor().endRow(xlsxReadContext); xlsxReadSheetHolder.setColumnIndex(null); xlsxReadSheetHolder.setCellMap(new LinkedHashMap<>()); } }
提示的异常或者没有达到的效果 test.xlsx
The text was updated successfully, but these errors were encountered:
有样式没有数据的情况下也算空行 [Issue #2294]
5ecff59
该问题已经在3.1.0+版本里面解决,最新版本:
3.1.0
Sorry, something went wrong.
对于csv的读取我看在3.1.1的版本里还是有这个问题
zhuangjiaju
No branches or pull requests
建议先去看文档
快速开始 、常见问题
触发场景描述
最后一行的cellMap实际上并没有值,但是并不为空,见debug截图
触发Bug的代码
提示的异常或者没有达到的效果
test.xlsx
The text was updated successfully, but these errors were encountered: