Yes, but would this not be the case if you did exactly the same with Excel
itself? If not, I cannot imagine how the file would be structured; the style
information has to be stored somewhere even if it is only the differences
from a notaional 'base' style that are stored.

Yours

Mark B


Khanh Tran-3 wrote:
> 
> Hello,
> 
> What if I programmatically format 500 cells with difference styles?
> 
> The target spreadsheet now contains huge number of styles.
> 
> Khanh
> 
> -----Original Message----
> 
>  
> 
> A cellstyle can be "shared" by many cells in a workbook. Currently you are
> 
> modifying the "shared" cellstyle, and this affects all cells that use that
> 
> style.
> 
>  
> 
> Instead, try to create a new style using HSSFWorkbook.createCellStyle(),
> and
> 
> then use cell.setCellStyle(HSSFCellStyle).
> 
>  
> 
> In other words, replace:
> 
>  
> 
>                   HSSFCellStyle cellStyle = cell.getCellStyle();
> 
>  
> 
> with:
> 
>  
> 
>                   HSSFCellStyle cellStyle = workbook.createCellStyle();
> 
>                   cell.setCellStyle(cellStyle);
> 
>  
> 
> - Rob
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/RE%3A-How-to-set-different-types-of-fomat-and-style-to-different-cell-tp25000554p25001251.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to