In Apache POI-HSSF, it seems like the HSSFCellStyle is global to the workbook. I assume that means that in order to, say, color cells as you add them, creating a new HSSFCellStyle for each would be hugely inefficient. In fact I've seen lots of messages here saying that Excel will complain if you create too many cell styles.
But if my data source makes it difficult to know all possible cell styles upfront (especially, since cell styles are combinations of font, color, border, etc), how can I know when I need to create a new one? I suppose I could keep a table of all the style parameter combinations I've encountered, but doesn't the library already do this? And if I did create a sheet where all the green cells shared a single cell style, would a user changing a single cell's color end up changing them all? Or would Excel be smart enough to detect that the cell now needs a new style created? I guess this boils down to a few questions: Is there a way to query your workbook while building it to find out whether a cell style you want to use matches one that's already in the workbook and to use that instead? If so, wouldn't it be nice to automate that and allow you to just set individual styles without incurring the inefficiency? I can't imagine Excel has a limit on how many unique combinations of cell attributes you can have. If that's true, does xls have some other mechanism for coloring cells, etc that isn't supported by poi? Rob --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
