thx, but i wrote the following and it doesn´t seem to work:
                        
HSSFCellStyle captionStyle = workBook.createCellStyle();
captionStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
captionStyle.setFillBackgroundColor(HSSFColor.RED.index);
captionStyle.setFillForegroundColor(HSSFColor.BLACK.index); 
captionStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
HSSFRow row = sheet.createRow((short) 0);
                
createExcelCaption(captionStyle, row, "DATUM", (short) 0);
createExcelCaption(captionStyle, row, "PERFORMANCE", (short) 1);
createExcelCaption(captionStyle, row, "VARIANTE", (short) 2);

Daniel

-----Ursprüngliche Nachricht-----
Von: Tom Schindl [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 28. März 2006 12:56
An: POI Users List
Betreff: Re: Excel - Backgroundcolor


Strange enough what you need is setFillForeground and the style is
HSSFCellStyle.SOLID_FOREGROUND

Tom


Beyer, Daniel (SL1 D) wrote:
> Hello,
> 
> i am new to POI and trying to generate an Excel-File.
> My prob ist that the background-color setting doesn´t work.
> 
> My Code ist here:
>                       
> HSSFCellStyle captionStyle = workBook.createCellStyle();
> captionStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
> captionStyle.setFillBackgroundColor(HSSFColor.RED.index);
> // captionStyle.setFillPattern(HSSFCellStyle.BORDER_THIN);
> HSSFRow row = sheet.createRow((short) 0);
>                       
> createExcelCaption(captionStyle, row, "DATUM", (short) 0);
> createExcelCaption(captionStyle, row, "PERFORMANCE", (short) 1);
> createExcelCaption(captionStyle, row, "VARIANTE", (short) 2);
> 
> Thx for help
>                       
> Greeting
>  
> Daniel 
> 
> 
> 
> ---------------------------------------------------------------------
> 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/
> 
> 



---------------------------------------------------------------------
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