Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. SXSSFWorkbook wb = new SXSSFWorkbook();
  2. wb.setCompressTempFiles(true);
  3.  
  4. SXSSFSheet sh = (SXSSFSheet) wb.createSheet();
  5. // sh.setRandomAccessWindowSize(100);// keep 100 rows in memory,
  6. // exceeding rows will be flushed to disk
  7. for (int rownum = 0; rownum < 100; rownum++) {
  8. Row row = sh.createRow(rownum);
  9. for (int cellnum = 0; cellnum < 10; cellnum++) {
  10. Cell cell = row.createCell(cellnum);
  11. String address = new CellReference(cell).formatAsString();
  12. cell.setCellValue(address);
  13. }
  14.  
  15. }
  16.  
  17. FileOutputStream out = new FileOutputStream("D:\tempsxssf.xlsx");
  18. wb.write(out);
  19. out.flush();
  20. out.close();
  21. wb.dispose();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement