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
1.word中的表格占位符必须写成 {{$fe:变量}},否则报错。原因是判断是否需要循环方法【checkThisTableIsNeedIterator()】对【$fe:】进行校验; 2.使用ExcelListEntity作为数据载体,渲染后占位符所在行不会删除; 3.使用List作为数据载体,会删除占位符所在行,但无法定义第一列占位符,导致第一列无法填充数据 4.关键方法如下: private void parseThisTable(XWPFTable table, Map<String, Object> map) throws Exception { XWPFTableRow row; List<XWPFTableCell> cells; Object listobj; for (int i = 0; i < table.getNumberOfRows(); i++) { row = table.getRow(i); cells = row.getTableCells(); //begin-------author:liusq------date:20210129-----for:-------poi3升级到4兼容改造工作【重要敏感修改点】-------- listobj = checkThisTableIsNeedIterator(cells.get(0), map); if (listobj == null) { parseThisRow(cells, map); } else if (listobj instanceof ExcelListEntity) { new ExcelEntityParse().parseNextRowAndAddRow(table, i, (ExcelListEntity) listobj); i = i + ((ExcelListEntity) listobj).getList().size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } else { ExcelMapParse.parseNextRowAndAddRow(table, i, (List) listobj); i = i + ((List) listobj).size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } }
private void parseThisTable(XWPFTable table, Map<String, Object> map) throws Exception { XWPFTableRow row; List<XWPFTableCell> cells; Object listobj; for (int i = 0; i < table.getNumberOfRows(); i++) { row = table.getRow(i); cells = row.getTableCells(); //begin-------author:liusq------date:20210129-----for:-------poi3升级到4兼容改造工作【重要敏感修改点】-------- listobj = checkThisTableIsNeedIterator(cells.get(0), map); if (listobj == null) { parseThisRow(cells, map); } else if (listobj instanceof ExcelListEntity) { new ExcelEntityParse().parseNextRowAndAddRow(table, i, (ExcelListEntity) listobj); i = i + ((ExcelListEntity) listobj).getList().size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } else { ExcelMapParse.parseNextRowAndAddRow(table, i, (List) listobj); i = i + ((List) listobj).size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1.word中的表格占位符必须写成 {{$fe:变量}},否则报错。原因是判断是否需要循环方法【checkThisTableIsNeedIterator()】对【$fe:】进行校验;
2.使用ExcelListEntity作为数据载体,渲染后占位符所在行不会删除;
3.使用List作为数据载体,会删除占位符所在行,但无法定义第一列占位符,导致第一列无法填充数据
4.关键方法如下:
private void parseThisTable(XWPFTable table, Map<String, Object> map) throws Exception { XWPFTableRow row; List<XWPFTableCell> cells; Object listobj; for (int i = 0; i < table.getNumberOfRows(); i++) { row = table.getRow(i); cells = row.getTableCells(); //begin-------author:liusq------date:20210129-----for:-------poi3升级到4兼容改造工作【重要敏感修改点】-------- listobj = checkThisTableIsNeedIterator(cells.get(0), map); if (listobj == null) { parseThisRow(cells, map); } else if (listobj instanceof ExcelListEntity) { new ExcelEntityParse().parseNextRowAndAddRow(table, i, (ExcelListEntity) listobj); i = i + ((ExcelListEntity) listobj).getList().size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } else { ExcelMapParse.parseNextRowAndAddRow(table, i, (List) listobj); i = i + ((List) listobj).size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 } }
The text was updated successfully, but these errors were encountered: