本文介绍了无法在Excel中显示颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在excel单元格中显示了以下代码.

Hi, I have the following code for a text displayed in excel cell.

<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>



当我从C#以
形式调用此代码时



When I Call this code from C# as

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


函数定义如下


where the function definition is as below

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);
}



在excel文件中,随着我更改大小,粗体,斜体属性而不更改颜色,文本也会更改.我尝试将颜色更改为#00FF00",将其放在其他属性之前,但没有任何效果.



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.

推荐答案


这篇关于无法在Excel中显示颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 12:09