【分享】Python实现列表背景色控制之获取基础资料属性
3人赞赏了该文章
3,854次浏览
编辑于2017年05月19日 11:41:30
刚入门学简单的Python开发小插件,修改列表的颜色,一直苦于获取不到列表的基础资料属性字段的值,比如物料里的是否正式件号字段,后来发现丁工回复一个人如何在e.DataRow中获取辅助资料数据包,豁然开朗。“字段名_Ref”获取数据包,然后再通过实体属性获取字段值。
import clr
clr.AddReference('System.Drawing')
clr.AddReference('Kingdee.BOS.Core')
from System.Drawing import *
from Kingdee.BOS.Core.Metadata import *
from Kingdee.BOS.Core.Report.PlugIn import *
def OnFormatRowConditions(e):
fc =FormatCondition()
fc.ApplayRow = True
#this.View.ShowMessage((e.DataRow['FMATERIALID_Ref'])['F_PAEZ_Combo_SFZSJH'].ToString())
if ((e.DataRow['FMATERIALID_Ref'])['F_PAEZ_Combo_SFZSJH'].ToString() == "2"):
fc.BackColor = "#FFFF00"
e.FormatConditions.Add(fc)
更多的内容请参考https://vip.kingdee.com/article/16737
import clr
clr.AddReference('System.Drawing')
clr.AddReference('Kingdee.BOS.Core')
from System.Drawing import *
from Kingdee.BOS.Core.Metadata import *
from Kingdee.BOS.Core.Report.PlugIn import *
def OnFormatRowConditions(e):
fc =FormatCondition()
fc.ApplayRow = True
#this.View.ShowMessage((e.DataRow['FMATERIALID_Ref'])['F_PAEZ_Combo_SFZSJH'].ToString())
if ((e.DataRow['FMATERIALID_Ref'])['F_PAEZ_Combo_SFZSJH'].ToString() == "2"):
fc.BackColor = "#FFFF00"
e.FormatConditions.Add(fc)
更多的内容请参考https://vip.kingdee.com/article/16737
推荐阅读