You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Beyer, Daniel (SL1 D)" <Da...@Dresdner-Bank.com> on 2006/03/28 12:50:00 UTC

Excel - Backgroundcolor

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


Re: Excel - Backgroundcolor

Posted by Tom Schindl <to...@gmx.at>.
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: 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/
> 
>