Browse Source

fix poi

release_toaliyun_real
lin 2 years ago
parent
commit
b9c81852f1
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/mem/AsyncTask.java

+ 13
- 1
mallinkAdmin/src/main/java/com/iformall/controller/mem/AsyncTask.java View File

@@ -404,7 +404,19 @@ public class AsyncTask {
}
private void exportExcel(HttpServletRequest request, HttpServletResponse response,List successList, Class dataClass, String fileName) throws Exception {
excelService.exportExcel(successList, null, "sheet1", dataClass, fileName, response, false);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workBook = ExcelExportUtil.exportExcel(exportParams, dataClass, successList);
response.setContentType("application/octet-stream;charset=UTF-8");
//response.setHeader("Content-Type", "application/vnd.ms-excel");//xls
response.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");//xlsx
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("GB2312"), "8859_1"));
response.addHeader("Pargam", "no-cache");
response.addHeader("Cache-Control", "no-cache");
OutputStream out = response.getOutputStream();
workBook.write(out);
out.flush();
out.close();
}
private String uploadErrorExcel(List successList, Class dataClass, String fileName) throws Exception {


Loading…
Cancel
Save