Open wangjunjun1998 opened 1 month ago
快速开始 、常见问题
public static void exportExcelByTemplate(String templatePath, List<? extends DataEntity> dataList , HttpServletResponse response, String exportName, Map<String, Object> headData) throws Exception { response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); ExcelWriter excelWriter = EasyExcel .write(getOutputStream(exportName, response)) .withTemplate(templatePath) .build(); WriteSheet writeSheet = EasyExcel.writerSheet().build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); excelWriter.fill(headData,fillConfig, writeSheet); excelWriter.fill(dataList,fillConfig, writeSheet); excelWriter.finish(); }
版本3.3.2 在使用固定模板导出文件时,索引 0 1 行为 head, 2 为数据替换行,3 为尾行文字描述 遍历数据,采取新增行方式(forceNewRow(Boolean.TRUE)),导出后,索引 3 尾行数据丢失,求告知 是被覆盖还是其他操作原因,求解决方法 ![Uploading 微信图片_20240826182713.png…]()
建议先去看文档
快速开始 、常见问题
异常代码
问题描述
版本3.3.2 在使用固定模板导出文件时,索引 0 1 行为 head, 2 为数据替换行,3 为尾行文字描述 遍历数据,采取新增行方式(forceNewRow(Boolean.TRUE)),导出后,索引 3 尾行数据丢失,求告知 是被覆盖还是其他操作原因,求解决方法 ![Uploading 微信图片_20240826182713.png…]()