HI,
I have problems in setting the background color of a header in the excel. The code I used was working previously but now it does not work... no color comes. The color that i am trying to set is an HTML color ( #cad8ea ) . the code is as follows -
//background colors
itemStyle.BackgroundColor.Source = "#cad8ea "
if (itemStyle.BackgroundColor != null)
{
//If the color is not a known color, set the palette with the color before using it
workbook.ChangePalette(System.Drawing.ColorTranslator.FromHtml(itemStyle.BackgroundColor.Source), 53);
//cell.Style.Pattern = BackgroundType.Gray6;
//cell.Style.BackgroundColor = System.Drawing.ColorTranslator.FromHtml(itemStyle.BackgroundColor.Source);
cell.Style.BackgroundColor = System.Drawing.ColorTranslator.FromHtml(itemStyle.BackgroundColor.Source);
cell.Style.Pattern = BackgroundType.Gray6;
}
I think its the porblem with the palette, but not sure. I get the color When i debug the code to see it the cell has the background after it has been set. But on the excel its blank. HOwever i tried some system color like blue and red , they do appear... could you plese tell me how i can correc this ?