Thanks.  I didn't get your email, but I was able to download your sample
from the URL you provided.  The sample works kind of like what I've coded
as a first cut to play around with hssf.

I pre-allocated styles for date cells and 'orange' cells, then applied the
styles on an as needed basis (odd-numbered columns in orange and auto-
detected dates).

Where it gets really complicated is when you start combining individual
cell attributes.  E.g. a date cell that's colored orange and displayed in
italics with a border at the top only.  All those things are elements of
a cell style.  To pre-allocate them, you need to build a table of all the
combinations in your data set.  Not just a 'date' cell, but every combo
of type, color, font, border, etc.  Scanning that table seems the same as
scanning all the styles in the workbook.  Sure, it's inefficient, but at
some point you're gonna need to do it.

Hopefully, using column styles and row styles would pare down the list
significantly, so that scanning wouldn't be too bad.

Anyway, I think I know what my options are.  Either maintain my own list
or write code to compare existing styles to what a cell's requesting.

Thanks for all the help.

By the way.  I posted another question today that hasn't shown up yet.
The 3.1 final docs say that HSSFRow has a setRowStyle method, but it's not
really there in HSSFRow.java.  As I said above, having row and column
styles will cut down on the number of times I have to locate a style in
my list.  If there's no setRowStyle, though, then it becomes more efficient
to maintain the style list outside the workbook.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to