Try this, without setting the FillBackgroundColor

// TURQUOISE "foreground", foreground being the fill foreground not the font
color.
    style.setFillForegroundColor(HSSFColor.TURQUOISE.index);
    style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);

Wassalam
Tahir
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Nazanin D
> Sent: Monday, February 19, 2007 1:39 PM
> To: [email protected]
> Subject: HSSF:Plain background color filling
> 
> Hi,
> 
> I am trying to fill a cell in excel sheet with a plain color and then
> write STH
> in that cell.
> 
> I am trying to use this code but it doesn't work.
> 
>          HSSFCellStyle styleSet = wb.createCellStyle();
> 
> styleSet.setFillBackgroundColor(HSSFColor.TURQUOISE.index);
> 
> styleSet.setAlignment(HSSFCellStyle.ALIGN_CENTER);
> 
> 
> if I add this line it works but the cell's color would not be plain
> anymore.
> 
>         styleSet.setFillPattern(HSSFCellStyle.LEAST_DOTS);
> 
> 
> 
> Could you please tell me how can I do such a thing.
> 
> 
> Best,
> Nazanin
> 
> 
> ---------------------------------------------------------------------
> 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