Hi, I am trying to create an xlsx file and I have used SXSSF Workbook. I am able to create a file with more than 100 rows when I run a java client independently. But when I deploy it on my Websphere 6.1 server it writes only the first 100 rows and skipping the rest of the rows. Can you please advice? I am using poi-3.8-beta5 version. Here is the code snippet. Workbook wb = new SXSSFWorkbook(100); // keep 100 rows in memory, exceeding rows will be flushed to disk SXSSFSheet sh = (SXSSFSheet)wb.createSheet(); for(int rownum = 0; rownum < 10000; rownum++){ Row row = sh.createRow(rownum); for(int cellnum = 0; cellnum < 35; cellnum++){ Cell cell = row.createCell(cellnum); //String address = new CellReference(cellnum).formatAsString(); cell.setCellValue("Hello World " + cellnum); } } FileOutputStream out; try { out = new FileOutputStream(filePath); wb.write(out); out.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }
It is a problem with WebSphere, not with POI. SXXSF writes temp files. Ensure your application has access to the temp directory. Yegor