0
触发场景描述 在本地导出excel是正常的,但是在linux服务器导出的excel就是损坏的。
触发Bug的代码
response.setContentType("application/vnd.ms-excel; charset=utf-8");
response.setCharacterEncoding("utf-8");
String fileName = "汇总报告-" + startDate + "~" + endDate + "数据报表";
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8") + ".xlsx");
EasyExcel.write(response.getOutputStream(), ReportDownloadAllVO.class).autoCloseStream(true).sheet("汇总报告").doWrite(dataListNew);
提示的异常或者没有达到的效果 没有任何异常,但是导出的excel是损坏的。