poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: Too many Cell Style objects
Date Tue, 08 Sep 2009 14:36:52 GMT

There may be another option if you are using the HSSF stream - as I assume
you are from your post. The HSSFCellUtil class contains methods that check
to see if a suitable style already exists within the workbook. Of course,
this will only allow you to re-use existing objects if they are suitable, if
you have a requirement for a great many different cell styles then it may be
the case that you need to look at using the OpenXML based file format rather
than the binary one; I do not think that the same limit is imposed here.

Before taking this decision, you would need to be confident that all of your
users were able to maintain those workbooks successfully. Earlier versions
of Excel can be patched so that they can read the xml based file formats but
only versions 2007 and beyond are able to  both read and write this file
format. OpenOffice is similarly limited to reading the OpenXML file format,
it cannot write files in this format and indeed will convert them to it's
own ODS format if the user opts to save the file.


Mark B

Patil Minal wrote:
> Hi,
>         I need to have a different data format for every cell in a report.
> I create this data format dynamically on the fly. But the problem is that
> I am not able to create a single HSSFCellStyle object for the entire
> column and reassign the HSSFDataFormat object for every row in that
> column. The CellStyle object doesn't seem to change with the changed
> DataFormat object. And If I create a HSSFCellStyle object for every cell,
> and if I exceed the limit of around 5000 objects or so then the POI does
> not apply any cell style to the data thereafter.
> Can anyone suggest some apt solution for the problem.
> - Minal.

View this message in context: http://www.nabble.com/Too-many-Cell-Style-objects-tp25345070p25347485.html
Sent from the POI - User mailing list archive at Nabble.com.

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

View raw message