Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have the following code for a text displayed in excel cell.

HTML
<style Halign="center" Valign="center" wrapText="true" includeAlign="true" includeFont="true" includeBorder="true">
  Pass_indicator
  <font  font="Arial" size="12" bold="true" italic="true" underline="None" Color = "Red" />
</style>


When I Call this code from C# as

C#
AddCellHeaderRowStyle_color(bool2str(PassFailStatusOverAll), 2, htBaseFormat, data);

where the function definition is as below

C#
private void AddCellHeaderRowStyle_color(string cellValue, int column, Hashtable htBaseFormat, ArrayList rowData)
{
    Hashtable htModifiedFormat = (Hashtable)htBaseFormat.Clone();
    htModifiedFormat[Common.COLUMNCOUNT] = column.ToString();
    htModifiedFormat[Common.ROWHEIGHT] = "36";
    htModifiedFormat[Common.STYLENAME] = "Pass_indicator";
    rowData.Add(cellValue);
    rowData.Add(htModifiedFormat);
}


in excel file, The text changes as I change the size, bold, italic attributes but not the color. I tried changing color to "#00FF00", putting it before other attributes but nothing works.
Posted
Updated 15-Feb-12 8:37am
v2
Comments
Sergey Alexandrovich Kryukov 15-Feb-12 21:18pm    
Where?!...
--SA
code_az 16-Feb-12 10:46am    
Hi SA,

I am using xml for the first time. So, I might be wrong.
shouldn't "color= red" specified in the above code change the color
of text in excel file?

sedy

1 solution

I see no signs of the code trying to change the color, so no wonder the color is not changing. :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900