poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan Krebs" <li...@krebsnet.com>
Subject Re: Lots of cell styles in one workbook
Date Thu, 18 Nov 2004 17:30:37 GMT
Karl, Ignore my last post I did not see the two other responses before
sending. Dave, I plan on doing exactly what you suggested, creating a
collection of reusable DataFormats at initialization time and then reusing
them as I write cells. I was little confused why you can get an index of
cell styles from the workbook but not data formats. I guess its does not
really matter though problem solved. - Duncan


----- Original Message ----- 
From: "Duncan Krebs" <lists@krebsnet.com>
To: "POI Users List" <poi-user@jakarta.apache.org>;
<karl-heinz.zengerle@sawag.com>
Sent: Thursday, November 18, 2004 11:17 AM
Subject: Re: Lots of cell styles in one workbook


> Karl, Thanks.
> I'm a little confused with the styles in general. I'm playing around with
a
> new HSSFWorkbook and see that by default it has 21 styles. How do I know
> what these styles are configured as?
>
> With the CellFormats (the one that I am mostly concerned about) I have
been
> writing Dates to HSSF as strings and noticed that Excel was not
recognizing
> these cells as Dates. From looking through some of the documentation I saw
> that if you apply the "mm-dd-yy" style on a HSSFDataFormat created from
the
> Workbook then Excel would treat it as a Date cell.
>
> The HSSFWorkbook does not have a collection of these unlike the cell
styles.
> Should I still be trying to create these at initialization time or should
I
> be creating a DataFormat for each cell that I write? Thanks for your
help. -
> Duncan
>
>
>
>
>
> ----- Original Message ----- 
> From: "KHZ (SAW)" <karl-heinz.zengerle@sawag.com>
> To: "'POI Users List'" <poi-user@jakarta.apache.org>
> Sent: Thursday, November 18, 2004 10:45 AM
> Subject: AW: Lots of cell styles in one workbook
>
>
> Hi Duncan.
>
> For all styles you've to do such things at an initialization phase (to
> have all such styles available at workbook level).
>
> Then you've to use (or better: get) that cell styles and use for your
> cells.
>
> Regards, Karl-Heinz.
>
>
> -----Urspr√ľngliche Nachricht-----
> Von: Duncan Krebs [mailto:lists@krebsnet.com]
> Gesendet: Donnerstag, 18. November 2004 17:45
> An: POI Users List
> Betreff: Lots of cell styles in one workbook
>
> Hi,
> I'm not sure if this is something I need to worry about but I have a set
> of classes that abstract the cell writing to HSSF worksheets and big
> part of that is automating cell format and cell style based on the type
> of value being written to the cell.
>
> So for example, if I'm writing a java.Date to a cell the class will
> apply a standard date format using the HSSFDataFormat. My question is,
> every time I set the data format or style for the cell I'm using the
> createCellStyle() and createDataFormat() on the workbook. If I do this
> for thousands of cells does it create a lot of overhead? Should I try to
> implement a pool of standard cell formats so I don't have to create one
> for each cell? Or does it not really matter? Also, is it possible set a
> data format on an entire column? Thanks. - Duncan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org
>


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


Mime
View raw message