InputStream templateInputStream = new FileInputStream("template.xls"); JxlsHelper jxlsHelper = JxlsHelper.getInstance(); Workbook workbook = jxlsHelper.createWorkbook(templateInputStream); Map<String, Object> model = new HashMap<>(); model.put("employees", employees); jxlsHelper.processTemplate(workbook, model); OutputStream outputStream = new FileOutputStream("report.xls"); workbook.write(outputStream); outputStream.close(); workbook.close(); groovy dependencies { implementation 'org.jxls:jxls:2.11.0' implementation 'org.jxls:jxls-poi:2.11.0' }


上一篇:
下一篇:
切换中文