想实现效果:如下图,几列数据中,
当比率小于30%时,背景红色,小于50%时,背景黄色,否则背景无(即白色),首先设立了2种样式(在界面中设置的,俺还不会用代码设置样式),名为:clr,cly,然后在表的DateChanged中写入代码:
Select Case e.Col.Name
Case "回款占总应收比率"
if e.datarow("回款占总应收比率")>0.5 then ‘比率大于50%时无背景颜色
e.style=isnothing
elseif e.datarow("回款占总应收比率")>0.3 then ’比率大于30%时背景样式为黄色
e.style="cly" ‘比率小于30%时背景样式为红色
else e.style="clr“
end if
end if
Case "回款占总应收比率" if e.datarow("确认收入占总应收比率")>0.5 then‘比率大于50%时无背景颜色
e.style=isnothing
elseif e.datarow("确认收入占总应收比率")>0.3 then’比率大于30%时背景样式为黄色
e.style="cly"‘比率小于30%时背景样式为红色
else e.style="clr“
end if
end if
End Select
此主题相关图片如下:bilu.png

[此贴子已经被作者于2013-4-6 20:15:49编辑过]