poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William S. Hayes" <...@fluctus.com>
Subject Re: "To many different cell formats"
Date Fri, 30 Jun 2006 17:28:37 GMT

2 ideas:

simple tabular output: just create one style for each column, then reuse 
that style each time you output an item in that particular style.

complex reports where all the styles needed are not necessarily known:  
Write an object that acts as a cache for the styles used so far.  So 
each time you go to create a style, check the cache to see if it still 
exists, if so use that one, otherwise create a new style and add it to 
the cache.

scott

Nidhi Tuli wrote:
> My excel has lot of data. It consists of 3 sheets and all three sheets
> have 300 rows with 15 columns. And we need all the rows and cells to
> have the borders so that its readable. So I used following code snippet
> for each cell. 
>  
>  
> HSSFCellStyle style = wb.createCellStyle();
>                         
> style.setBorderTop(HSSFCellStyle.BORDER_THIN);
> style.setTopBorderColor(HSSFColor.BLACK.index);
> style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
> style.setBottomBorderColor(HSSFColor.BLACK.index);
> style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
> style.setLeftBorderColor(HSSFColor.BLACK.index);
> style.setBorderRight(HSSFCellStyle.BORDER_THIN);
> style.setRightBorderColor(HSSFColor.BLACK.index);
> cell.setCellStyle(style);
>  
> When I create and format these cells POI does not complain anything. But
> when I open the huge excel with that much formatting it complains "To
> many different call formats". 
>  
> Any idea how to get ride of this?
>  
> Thanks in advance.
> Nidhi
>  
>  
>
>   

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


Mime
View raw message