wxdChinese opened a new issue, #773: URL: https://github.com/apache/fesod/issues/773
### Search before asking - [x] I searched in the [issues](https://github.com/apache/fesod/issues) and found nothing similar. ### Fesod version 1.3.0 ### JDK version 17 ### Operating system windows11 ### Steps To Reproduce public static importExcel(MultipartFile file) { FastExcelUploadDataListener<QuestionExcel> listener = new FastExcelUploadDataListener<>(); List<QuestionFailedExcel> errorList = new ArrayList<>(); File importTempFile = null; try { importTempFile = File.createTempFile(UUID.randomUUID().toString(), ".xlsx"); file.transferTo(importTempFile); FastExcel.read(importTempFile, QuestionExcel.class, listener) .ignoreEmptyRow(false) .sheet() .doRead(); List<QuestionExcel> list = listener.getList(); errorList = new ArrayList<>(list); } catch (Exception e) { log.error("===========", e); } finally { if (importTempFile != null) { importTempFile.delete(); } } File tempFile = null; try { // 创建输出文件 tempFile = File.createTempFile(UUID.randomUUID().toString(), ".xlsx"); // 加载模板 try (InputStream failedTemplate = QuestionUtil.class.getResourceAsStream("/template/excel/exam/questionFailedTemplate.xlsx");) { // 读取模板并写入数据(忽略注解中的表头) FastExcel.write(tempFile) .withTemplate(failedTemplate) // 使用模板 .sheet()// 默认第一个 sheet .head(QuestionFailedExcel.class) .needHead(false) .doWrite(errorList); // 写入数据列表 } catch (Exception e) { log.error("写入错误信息失败", e); throw new ServiceException("写入错误信息失败"); } } ### Current Behavior FastExcel.write出来的文件会有FastExcel.read中的公式,如wps的嵌入图片 ### Expected Behavior FastExcel.write中全是新的东西,不应该有read中的其他隐性的东西。 ### Anything else? _No response_ ### Are you willing to submit a PR? - [x] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
