Guest User

Untitled

a guest
Feb 17th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. XSSFWorkbook wbk_template = new XSSFWorkbook(new FileInputStream (f_wbk_template));
  2. SXSSFWorkbook wbk = new SXSSFWorkbook(wbk_template, 50, true);
  3.  
  4. Sheet sheet = wbk.getSheet(STR_SHEET_NAME);
  5.  
  6. Row row = sheet.getRow(rownum);
  7. if (null == row) {
  8. row = sheet.createRow(rownum);
  9. }
  10.  
  11. java.lang.IllegalArgumentException: Attempting to write a row[2] in the range [0,48] that is already written to disk.
  12. at org.apache.poi.xssf.streaming.SXSSFSheet.createRow(SXSSFSheet.java:122)
  13. ...
  14.  
  15. XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(file));
  16.  
  17. //do the read and edit operation with xssf......
  18. ......
  19. ......
  20.  
  21. SXSSFWorkbook sXSSFbook = new SXSSFWorkbook(xssfWorkbook);
  22.  
  23. //do the write operation with sxssf......
  24. ......
  25. ......
Add Comment
Please, Sign In to add comment