本帖最后由 Joestar.Xu 于 2023-10-16 10:28 编辑
您直接参考我的代码,只需要修改items中的fieldName即可。
代码如下:
var style1 = new GC.Spread.Sheets.Style(); //设置列的样式
style1.formatter = "0.0";
style1.backColor = "red";
var style2 = new GC.Spread.Sheets.Style(); //设置列的样式
style2.formatter = "#,##0";
style2.backColor = "green";
pt1.setStyle({
dataOnly: true,
references: [
{
fieldName: "值",
items: ['amount']
}]
},
style2
);
pt1.setStyle(
{
dataOnly: true,
references: [
{
fieldName: "值",
items: ['rate']
}]
},
style1
); |