|
|
@ -123,6 +123,9 @@ public class PoiUtil { |
|
|
|
* @return 返回生成的excel数据 |
|
|
|
*/ |
|
|
|
public static Workbook exportWB(String sheetName, List<List<PoiUtilCell>> rows, Workbook wb) { |
|
|
|
return exportWB(sheetName, 0, rows, wb); |
|
|
|
} |
|
|
|
public static Workbook exportWB(String sheetName, int rowIndex, List<List<PoiUtilCell>> rows, Workbook wb) { |
|
|
|
|
|
|
|
// 第一步,创建一个XSSFWorkbook,对应一个Excel文件
|
|
|
|
if (wb == null) { |
|
|
@ -155,9 +158,9 @@ public class PoiUtil { |
|
|
|
|
|
|
|
//创建内容
|
|
|
|
for (int i = 0; i < rows.size(); i++) { |
|
|
|
Row row = sheet.getRow(i); |
|
|
|
Row row = sheet.getRow(i+rowIndex); |
|
|
|
if (ObjectUtil.isNull(row)) { |
|
|
|
row = sheet.createRow(i); |
|
|
|
row = sheet.createRow(i + rowIndex); |
|
|
|
} |
|
|
|
List<PoiUtilCell> cells = rows.get(i); |
|
|
|
for (int j = 0; j < cells.size(); j++) { |
|
|
|