/* * 表具模板导出 * */ @GetMapping(value = "/downloadBatchPutOnRecordTemplate" , produces = {"application/json;charset=UTF-8"}) public void downloadBatchPutOnRecordTemplate(HttpServletResponse response) throws IOException { try { byte[] fileSource = ProjectConfiguration2.fileBytes; //防止对原数据进行操作 byte[] fileBytes = Arrays.copyOf(fileSource, fileSource.length); String name = "表具导入模板"; //下载模板 response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(name,"UTF-8") + ".xlsx"); response.setHeader("Content-Type", "application/vnd.ms-excel"); response.setCharacterEncoding("UTF-8"); response.getOutputStream().write(fileBytes); response.setContentLength(fileBytes.length); } finally { if (response.getOutputStream() != null) { r
Springboot中excel模板导出(笔记、(12))
于 2022-10-10 09:02:33 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)