I have been trying to fix the problem with SXSSFWorkbook written in Java
code. The generated .xlsx file which opens fine in Open office but the same
file opens as empty into Numbers '09.
Do you have solution for this ? I am using poi 3.8 beta 4.
Here is the sample basic code.
public static void main(String[] args) throws Throwable {
Workbook wb = new SXSSFWorkbook(100);
Sheet sh = wb.createSheet();
for(int rownum = 0; rownum < 100; rownum++){
Row row = sh.createRow(rownum);
for(int cellnum = 0; cellnum < 10; cellnum++){
Cell cell = row.createCell(cellnum);
cell.setCellType(Cell.CELL_TYPE_STRING);
cell.setCellValue("a");
}
// manually control how rows are flushed to disk
if(rownum % 100 == 0) {
((SXSSFSheet)sh).flushRows(100); // retain 100 last rows and
flush all
others
}
}
FileOutputStream out = new
FileOutputStream("/Users/me/Desktop/testing_xssf.xlsx");
wb.write(out);
out.close();
}
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/poi-3-8-beta-4-SXSSFWorkbook-xlsx-file-empty-in-Numbers-tp4972454p4972454.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]