[python学习笔记]设置单据体字段字体颜色(前景色)

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

[python学习笔记]设置单据体字段字体颜色(前景色)

clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.DataEntity')
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
from Kingdee.BOS.Orm.DataEntity import *

def AfterBindData(e):
    entity = this.View.BillBusinessInfo.GetEntity('FEntity') # FEntity 为单据体标识
    objCollection =this.View.Model.GetEntityDataObject(entity)
    grid =this.View.GetControl('FEntity')
    for index in range(len(objCollection)):
        obj = objCollection[index]
        valDebit = obj["Score"]
        if valDebit is not None :
            grid.SetForecolor("FScore","#FF0000", index);#需要设置字段标识Key

   

效果如图:

图片.webp





特别注意,python非常注意缩进,一定记得保持缩进!!!



不是设置单据体的颜色,是要设置单据体字段标题的颜色


背景色同理,只需要把最后一行改成j即可:

grid.SetBackcolor("FScore","#FFFF00", index);#需要设置字段标识Key


效果如图:

图片.webp


[python学习笔记]设置单据体字段字体颜色(前景色)

clr.AddReference('Kingdee.BOS.Core')clr.AddReference('Kingdee.BOS.DataEntity')from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlMod...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息