ColdFusion 2021 SpreadsheetFormatCell 颜色

问题描述

最近从 CF11 升级到 CF2021。我有一个电子表格,我们用颜色来格式化单元格、行和列,特别是背景颜色。我指定了 color= 或 fgcolor=。无论我选择什么颜色,它都会是黑色的。我搜索搜索了 2021 年,但一无所获。

有人有解决方案吗?

非常简化的代码。它适用于 CF11 和 CF2016。

<cfscript>
    sObj = SpreadsheetNew("Testing Summary","yes");
    SpreadsheetSetCellValue(sObj,"As of: " & DateFormat(#DateAdd("h",-1,Now())#),1,1); 
    SpreadsheetFormatCell(sObj,{bold="true",fontsize="14"},1);
    SpreadsheetMergeCells(sObj,5);
    SpreadsheetSetCellValue(sObj,"Testing Summary",2,1); 
    SpreadsheetMergeCells(sObj,5);
    SpreadsheetFormatCell(sObj,fontsize="20",fgcolor="blue",color="yellow"},1);
</cfscript>

<!--- Launch File to User --->

<cfheader name="Content-disposition" value="attachment; filename=MySpreadsheet.xlsx"> 
<cfcontent type="application/vnd.ms-excel" variable="#SpreadsheetReadBinary( sObj )#"> 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)