报表导出时报异常:
org.apache.poi,openxml4j.exceptions.openxml4jruntimeexception:
fail to save:an error occurs while saving the package:the part /docProps/core.xml fail to be saved in the stream with marshaller org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller@79f7dd2
报表对象XSSFWorkbook生成以后,需要单独处理最后一行:获取最后一个表单的最后一行。
@GetMapping("/exportExcel")
public ObjectRestResponse<PageInfo> exportExcel(
HttpServletRequest request,
HttpServletResponse response) throws Exception {
OutputStream outputStream = null;
try {
XSSFWorkbook xssfWorkbook = profitService.export(toExportList, new BaseEntity());
// /**合并单元格:最后一个sheet最后一行(合计栏),需要合并单元格**/
//XSSFSheet lastSheet = xssfWorkbook.getSheetAt(toExportList.size() - 1); //①
//int lastRowNum = lastSheet.getLast