0

i have try but not effect in report so please help me...

Report --> ReportProperty --> Code

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

Placeholder Property ---> Font--> Color

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

i have also try Placeholder Property ---> Font--> Color

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

but some value not Change Color like biillamount 140 Rs and Paidamount 40 Rs but not change color this type Value

  • Be careful with comparing amounts when the variables are strings. `paidamt < billamt` will not always give you the intended result. – StevenWhite Jun 27 '16 at 19:37

1 Answers1

0

In field property, select color then select expression and write your code i.e IIf('condition', "color1" , "color2")

Abhay Dixit
  • 998
  • 8
  • 28