easyexcel 多列表填充若同一列有两个列表数据源,填充后两个列表数据展示错乱

vm0i2vca  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(61)

相关代码:
excelWriter = EasyExcelFactory.write(byteArrayOutputStream).withTemplate(templateFileInputStream).build();
WriteSheet writeSheet = EasyExcelFactory.writerSheet(sheetIndex).build();
writeSheet.setSheetName(sheetNames);
// 如果有多个list 模板上必须有{前缀.} 这里的前缀就是 data1,然后多个list必须用 FillWrapper包裹
List data = sheetList.getOrDefault("data", Collections.emptyList());
if (!data.isEmpty()) {
excelWriter.fill(new FillWrapper("data", data), writeSheet);
}
List data1 = sheetList.getOrDefault("data1", Collections.emptyList());
if (!data1.isEmpty()) {
excelWriter.fill(new FillWrapper("data1", data1), writeSheet);
}

相关问题