Structure is like this (from memory and I wrote this part like 5 years ago so check me on this):

[BOFRecord type=Workbook]
....
FormatRecord
...
XFRecord (0)
XFRecord (1)
XFRecord (2)
XFRecord (3)
XFRecord (5!!!!)
XFRecord (6)....(255 IIRC is max)
....
[/EOFRecord]
[BOFRecord type=Sheet]
...
SSTRecord (pooled strings)
...
ColumnInfo (contains XF index)
ColumnInfo (contains XF index)
...
RowRecord
RowRecord number (contains XF index)
...
NumericRecord col, row fields (contains XF index)
LabelSSTRecord (refers to indexed strings)
...
[/EOFRecord]
[BOFRecord type=Sheet]
...
[/EOFRecord]
....

So yes, doing that should work. Its just that then you've overridden the cell style for each cell that you did this. Meaning that they no longer are just getting the style from their row or the column. Not bad per se but just it accomplishes something different structurally even if the cosmetic appearance is the same. That and you'll be reading the file twice and it will consume about twice as much memory and POI loves its heap space man. And I'm betting you're on an IBM VM on a AIX, zOS, OS/400 or OS/390 box. Those have the slowest saddest VM GC implmentations this side of the Sun so you should conserve that memory. (The IBM Linux VM's GC ain'
great for high scale either, the benchmarks simply lie)

-Andy

Peter Dow (DSS) wrote:

Hi Andy,

I like your concise statement of my problem ("We're defaulting to overriding
it by setting cell style on each cell.  You're then trying to "un-override"
it.").  If you guys can fix it, that solves my problem!

But I'm still curious.  As I understand it, the cell style records are
extended format records in the workbook stream, with their index as a value
within the record, not something determined by their position within the
stream.  If I were to gain access to the ColumnInfo records and save the
XFIndex values for each column, then immediately open the same sheet for
modification, wouldn't the XFIndex values still be valid?  I could then
create HSSFCellStyle objects by using the getCellStyleAt(xfindex) method and
apply it to the new cell.   --This is just for my understanding; I much
prefer your fix! It'll make my code a lot cleaner.

Peter Dow
Dow Software Services, Inc.
www.dowsoftware.com
909 793-9050 voice
909 793-4480 fax



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/52 - Release Date: 7/19/2005



--
Andrew C. Oliver
SuperLink Software, Inc.

Java to Excel using POI
http://www.superlinksoftware.com/services/poi
Commercial support including features added/implemented, bugs fixed.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to