List of usage examples for org.apache.poi.xssf.streaming SXSSFWorkbook getXSSFWorkbook
public XSSFWorkbook getXSSFWorkbook()
From source file:org.apache.tika.eval.reports.Report.java
License:Apache License
private void dumpXLSX(Connection c, Path reportsRoot) throws IOException, SQLException { Statement st = c.createStatement(); Path out = reportsRoot.resolve(reportFilename); Files.createDirectories(out.getParent()); SXSSFWorkbook wb = new SXSSFWorkbook(new XSSFWorkbook(), 100, true, true); wb.setCompressTempFiles(true);//from w w w . ja va 2 s . com defaultIntegerFormatter.reset(wb.getXSSFWorkbook()); defaultDoubleFormatter.reset(wb.getXSSFWorkbook()); sqlCellStyle = wb.createCellStyle(); sqlCellStyle.setVerticalAlignment(VerticalAlignment.TOP); sqlCellStyle.setWrapText(true); try { dumpReportToWorkbook(st, wb); } finally { try (OutputStream os = Files.newOutputStream(out)) { wb.write(os); } finally { wb.dispose(); } } }