From 08e93b7fc616ef125acfec0e3762977ef73634ab Mon Sep 17 00:00:00 2001 From: zhousq Date: Sun, 18 Feb 2024 17:05:43 +0800 Subject: [PATCH] =?UTF-8?q?2024-02-18=20=E4=BF=AE=E6=94=B9=E6=88=90?= =?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E6=96=B9=E5=BC=8F=E7=9A=84excel?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AF=BC=E5=87=BA=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?xlsx=EF=BC=8C=E6=95=B0=E6=8D=AE=E5=88=97=E5=A4=A7=E4=BA=8E256?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lzbi/bi/controller/DcBusiHisReportController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiHisReportController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiHisReportController.java index a97f0a3..4b13173 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiHisReportController.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiHisReportController.java @@ -3,6 +3,7 @@ package com.lzbi.bi.controller; import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.IoUtil; +import cn.hutool.poi.excel.BigExcelWriter; import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelWriter; import com.alibaba.fastjson2.JSONObject; @@ -244,10 +245,11 @@ public class DcBusiHisReportController extends BaseController { } private void toExcel(HttpServletResponse response,List> mapList) throws IOException { - String fileName ="report"+DateUtil.now() + ".xls"; + String fileName ="report"+DateUtil.now() + ".xlsx"; response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setCharacterEncoding("utf-8"); - ExcelWriter writer = ExcelUtil.getWriter(true); + //ExcelWriter writer = ExcelUtil.getWriter(true); + BigExcelWriter writer= ExcelUtil.getBigWriter(); writer.write(mapList, true); //test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码 //response.setHeader("Content-Disposition", "attachment;filename="+fileName);