| | |
| | | private List<MetaTemplate> metaTemplateList; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void doRender(RenderContext<Object> context) throws Exception { |
| | | RunTemplate runTemplate = (RunTemplate) context.getEleTemplate(); |
| | |
| | | if (i == 0) { |
| | | row = fieldRow; |
| | | } else { |
| | | int fieldRowIndex = xwpfTable.getRows().indexOf(fieldRow); |
| | | //创建一行在fieldRowIndex下面 |
| | | row = xwpfTable.insertNewTableRow(xwpfTable.getRows().size()); |
| | | row = xwpfTable.insertNewTableRow(fieldRowIndex + i); |
| | | PrintPoiUtil.copyTableRow(row, fieldRow); |
| | | } |
| | | //遍历字段每个字段创建一个单元格 |
| | |
| | | XWPFParagraph xwpfParagraph = cell.addParagraph(); |
| | | int index = cell.getParagraphs().indexOf(xwpfParagraph); |
| | | PrintPoiUtil.copyParagraph(xwpfParagraph, cell.getParagraphs().get(0)); |
| | | //设置段落文字对齐方式 |
| | | xwpfParagraph.setAlignment(cell.getParagraphs().get(0).getAlignment()); |
| | | //删除所有的run |
| | | for (int k = xwpfParagraph.getRuns().size() - 1; k >= 0; k--) { |
| | | xwpfParagraph.removeRun(k); |