We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public String createReportData(ReportTemplate reportTemplate,Long stationId,Long year,Long month) { //List<Map<String,Object>> reportFillDataMap = getReportFillData(stationId,year,month); List<Map<String,String>> dateList = getDayOfMonth(year,month); Map<String,String> nameMap = new HashMap<>(); File file2 = new File(sysInit.getFileUploadPath() + "temp/"); if (!file2.exists()) { file2.mkdirs(); } //根据Excel模板生成数据报表 String templateFilePath = sysInit.getFileUploadPath() + reportTemplate.getReportUrl(); String fileExtension = templateFilePath.substring(templateFilePath.lastIndexOf(".")); String reportFilePath = "temp/" + Calendar.getInstance().getTimeInMillis() + fileExtension; ExcelWriter excelWriter = EasyExcel.write(sysInit.getFileUploadPath() + reportFilePath).withTemplate(templateFilePath).build(); Workbook workbook = excelWriter.writeContext().writeWorkbookHolder().getWorkbook(); workbook.setForceFormulaRecalculation(true); int sheetNum = workbook.getNumberOfSheets(); FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.HORIZONTAL).build(); for (int i = 0; i < sheetNum; i++) { WriteSheet writeSheet = EasyExcel.writerSheet(i).build(); excelWriter.fill(dateList,fillConfig, writeSheet); } excelWriter.finish(); return reportFilePath; }
The text was updated successfully, but these errors were encountered:
zhuangjiaju
No branches or pull requests
The text was updated successfully, but these errors were encountered: