@@ -18,7 +18,6 @@ package org.jeecgframework.poi.word.parse; | |||||
import static org.jeecgframework.poi.util.PoiElUtil.*; | import static org.jeecgframework.poi.util.PoiElUtil.*; | ||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.Collection; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
@@ -222,8 +221,10 @@ public class ParseWord07 { | |||||
} else if (listobj instanceof ExcelListEntity) { | } else if (listobj instanceof ExcelListEntity) { | ||||
table.removeRow(i);// 删除这一行 | table.removeRow(i);// 删除这一行 | ||||
new ExcelEntityParse().parseNextRowAndAddRow(table, i, (ExcelListEntity) listobj); | new ExcelEntityParse().parseNextRowAndAddRow(table, i, (ExcelListEntity) listobj); | ||||
i = i + ((ExcelListEntity) listobj).getList().size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 | |||||
} else { | } else { | ||||
ExcelMapParse.parseNextRowAndAddRow(table, i, (List) listobj); | ExcelMapParse.parseNextRowAndAddRow(table, i, (List) listobj); | ||||
i = i + ((List) listobj).size() - 1;//删除之后要往上挪一行,然后加上跳过新建的行数 | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -57,7 +57,7 @@ public class ExcelEntityParse extends ExportBase { | |||||
private int createCells(int index, Object t, List<ExcelExportEntity> excelParams, | private int createCells(int index, Object t, List<ExcelExportEntity> excelParams, | ||||
XWPFTable table, short rowHeight) throws Exception { | XWPFTable table, short rowHeight) throws Exception { | ||||
ExcelExportEntity entity; | ExcelExportEntity entity; | ||||
XWPFTableRow row = table.createRow(); | |||||
XWPFTableRow row = table.insertNewTableRow(index); | |||||
row.setHeight(rowHeight); | row.setHeight(rowHeight); | ||||
int maxHeight = 1, cellNum = 0; | int maxHeight = 1, cellNum = 0; | ||||
for (int k = 0, paramSize = excelParams.size(); k < paramSize; k++) { | for (int k = 0, paramSize = excelParams.size(); k < paramSize; k++) { | ||||
@@ -75,7 +75,7 @@ public final class ExcelMapParse { | |||||
int cellIndex = 0;// 创建完成对象一行好像多了一个cell | int cellIndex = 0;// 创建完成对象一行好像多了一个cell | ||||
Map<String, Object> tempMap = Maps.newHashMap(); | Map<String, Object> tempMap = Maps.newHashMap(); | ||||
for (Object obj : list) { | for (Object obj : list) { | ||||
currentRow = isCreate ? table.createRow() : table.getRow(index++); | |||||
currentRow = isCreate ? table.insertNewTableRow(index++) : table.getRow(index++); | |||||
tempMap.put("t", obj); | tempMap.put("t", obj); | ||||
for (cellIndex = 0; cellIndex < currentRow.getTableCells().size(); cellIndex++) { | for (cellIndex = 0; cellIndex < currentRow.getTableCells().size(); cellIndex++) { | ||||
String val = eval(params[cellIndex], tempMap).toString(); | String val = eval(params[cellIndex], tempMap).toString(); | ||||