easyexecl 文件损坏记录
作者:互联网
点击查看代码
// sheet页角标
int sheetNum = 1;
for (int i = 0; i < excelSize; i++) {
if (i < (patchListCount / maxSize) + 1) {
if (patchListCount > maxSize) {
// 分页查询
dataByOperatorExcel =
if (i == 0) {
// 不能提取到最外面,否则直接走else 会造成sheet 重复,文件无法打开
writeSheet = EasyExcelFactory.writerSheet(patchSheetName).build();
// 获取补丁 sheet和 writer-------为了 100万数据分俩次写入同一个sheet
writer = getExcelWriter(path, patchListTitle, patchSheetName, writer);
}
if (i % 2 == 0 && i !=0) {// 超过1000000万下一个sheet页
writeSheet = EasyExcelFactory.writerSheet(patchSheetName + sheetNum).build();
sheetNum++;
}
// 根据自定义列获取数据
List<List<Object>> lists = ExcelUtils.contentData(dataByOperatorExcel, patchPropertyList);
writer.write(lists, writeSheet);
} else {
//分页查询
// 导出
}
}
}
标签:sheet,记录,int,writer,writeSheet,损坏,sheetNum,easyexecl,patchSheetName 来源: https://www.cnblogs.com/adai-study-1030/p/16396209.html