poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Beardsley <markbrd...@tiscali.co.uk>
Subject Re: [Bug 53650] New: SXSSF can be made to output corrupt XLSX files
Date Sat, 04 Aug 2012 08:20:43 GMT
I am by no means an expert on the use of the SXSSF stream but did have a
quick look at the javadoc. The first thing to check, it seems, is that you
are not trying to over-write any existing rows/cells when creating the
currentRow object. The javadoc looks like this;

/SXSSFWorkbook

public SXSSFWorkbook(XSSFWorkbook workbook)

   Construct a workbook from a template.

   There are three use-cases to use SXSSFWorkbook(XSSFWorkbook) :

        Append new sheets to existing workbooks. You can open existing
workbook from a file or create on 
        the fly with XSSF.
        Append rows to existing sheets. The row number MUST be greater than
max(rownum) in the 
        template sheet.
        Use existing workbook as a template and re-use global objects such
as cell styles, formats, images, 
        etc.

    All three use cases can work in a combination.

    What is not supported:

        Access initial cells and rows in the template. After constructing
SXSSFWorkbook(XSSFWorkbook) all 
        internal windows are empty and SXSSFSheet@getRow and
SXSSFRow#getCell return null.
        *Override existing cells and rows. The API silently allows that but
the output file is invalid and Excel 
        cannot read it.*

    Parameters:
        workbook - the template workbook/

and it is the last part - the part now in bold - that I wonder if you might
be violating. Check the template file to make sure that it does not violate
this exception maybe.

Yours

Mark B



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Bug-53650-New-SXSSF-can-be-made-to-output-corrupt-XLSX-files-tp5710608p5710611.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message