Sep 1, 2009 at 2:59 PM
Edited Sep 1, 2009 at 3:13 PM
The following code will NOT set the FillBackgroundProperty if the foreground color has not been set previously.
HSSFCellStyle style = _thisBook.CreateCellStyle();
style.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.PINK.index;
It appears to be in the logic in the HSSFCellStyle.CheckDefaultBackgroundFills(). It prevents me from using the automatic foreground color with a custom background color, it even goes so far as to reset the background color if the foreground color
is reset to automatic.
Is there a particular reason why you can not change the background color of a cell without changing the foreground color from automatic?
Also, how do a set the background fill to a solid? I see foreground fill of solid, but background all seem to be a pattern. I don't want a pattern, I want a solid fill with no pattern.