style.FillBackgroundColor

Feb 2, 2010 at 7:35 PM

I might be missing something, so please let me know

 

I have the following

 

        HSSFCellStyle coral1 = hssfworkbook.CreateCellStyle();
        coral1.Alignment = CellHorizontalAlignment.CENTER;
        coral1.BorderTop = CellBorderType.THIN;
        coral1.BorderLeft = CellBorderType.THIN;
        coral1.BorderBottom = CellBorderType.THICK;
        coral1.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.BLACK.index;
        coral1.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.CORAL.index;
        coral1.FillPattern = CellFillPattern.LEAST_DOTS;

        HSSFCellStyle coral1 = hssfworkbook.CreateCellStyle();

        coral1.Alignment = CellHorizontalAlignment.CENTER;

        coral1.BorderTop = CellBorderType.THIN;

        coral1.BorderLeft = CellBorderType.THIN;

        coral1.BorderBottom = CellBorderType.THICK;

        coral1.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.BLACK.index;

        coral1.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.CORAL.index;

        coral1.FillPattern = CellFillPattern.LEAST_DOTS;

Which will make the background color without problems, however, I do not wish to have a pattern.

So if I leave out the FillPattern Line, the background color doesn't change to coral. If I put the fillpattern to NO_FILL, it doesn't change the background color.

Any help would be appreciated.

Thanks,

Ryan

 

Feb 2, 2010 at 7:50 PM

Ok, I got it. Foreground and Background are reversed. Fixed it. Nevermind.

Mar 20, 2010 at 1:37 PM

Yes, can you fix this bug ???????????