如何在RDLC报告字段中应用颜色?

时间:2016-06-24 11:14:01

标签: c# ssrs-2008 rdlc dynamic-rdlc-generation

我已尝试但未在报告中生效,所以请帮助我......

报告 - > ReportProperty - >代码

Public Function GetColor(ByVal st as String,ByVal billamt as String,ByVal paidamt as String) As String
Dim retVal as String = ""
If(st = "Paid" & paidamt != "0" & paidamt < billamt )
retVal = "Blue"
Else If (st = "Unpaid")
retVal = "Red"
Else
retVal = "Black"
End If
Return retVal
End Function

占位符属性---&gt;字体 - &GT;颜色

=Code.GetColor(Fields!estatus.Value,Fields!billamt.Value,Fields!paidamt.Value)
我也尝试过 占位符属性---&gt;字体 - &GT;颜色

=IIf((Fields!paidamt.Value ="0") , "Red" ,
IIf(( Fields!paidamt.Value < Fields!billamt.Value ), "Blue" , "Black"))

但有些值不是改变颜色 像biillamount 140 Rs和Paidamount 40 Rs但不改变颜色这种类型值

1 个答案:

答案 0 :(得分:0)

在字段属性中,选择颜色,然后选择表达式并编写代码 即IIf(&#39;条件&#39;,&#34; color1&#34;,&#34; color2&#34;)