0

我已经尝试但在报告中没有效果所以请帮助我......

报告 --> 报告属性 --> 代码

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

占位符属性--->字体-->颜色

=Code.GetColor(Fields!estatus.Value,Fields!billamt.Value,Fields!paidamt.Value)

我也尝试过占位符属性--->字体->颜色

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

但某些值不会更改颜色,例如 biillamount 140 Rs 和 Paidamount 40 Rs 但不会更改此类型的颜色值

4

1 回答 1

0

在字段属性中,选择颜色,然后选择表达式并编写代码,即 IIf('condition', "color1" , "color2")

于 2016-06-24T11:27:26.160 回答