I have identified the commit below as being responsible, I have reverted it
for now to ensure we do more investigation before putting that fix into
place once again. Unfortunately no unit test captured this, only Excel
reported the files as being corrupt if an empty "<cols/>" element is in the
xlsx.

Revision: 1513916
Author: centic
Date: Mittwoch, 14. August 2013 16:57:44
Message:
Bug 52233: Do not make the XSSFSheet invalid during write(), I could not
find out why the ColsArray was set to null in the write() method. By
removing this the writing of the sheet does not invalidate the Workbook any
more and makes the test case work fine.
----
Modified :
/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Modified :
/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java

Dominik
Hi,

I just found that xlsx-files produced by the latest builds of poi cannot be
opened in my version of Excel any more, anybody else have similar problems
or is this something related to my local environment?

Even the simplest possible file already is reported corrupt for me, anybody
seeing this as well? The files can be read fine by POI itself, 3.9 seems to
still work fine, I am still testing 3.10beta1 to narrow it down...

        Workbook workbook = new XSSFWorkbook();

        String filename = "C:\\temp\\poi-bug.xlsx";
        FileOutputStream file = new FileOutputStream(filename);
        try {
            workbook.write(file);
        } finally {
            file.close();
        }

Dominik.

Reply via email to