I have a pretty complicated IIF expression in SSRS, in which I want to change the background color of the cell will change based on certain conditions. It works fine in its current state, but I am trying to add a Like condition to it...
so, here's what it looks like now (working):
=IIf(inscope("matrix1_errorType"),
IIf(
(
FormatPercent(Sum(Fields!numberOfIssues.Value)/First(Fields!totalItems.Value),3) >= .0001 & "%"
And ( First(Fields!errorType.Value) = "TypeA")
)
Or
(
FormatPercent(Sum(Fields!numberOfIssues.Value)/First(Fields!totalItems.Value),3) >= .04 & "%"
And First(Fields!errorType.Value) = "TypeB"
)
Or
(
FormatPercent(Sum(Fields!numberOfIssues.Value)/First(Fields!totalItems.Value),3) >= .02 & "%"
And First(Fields!errorType.Value) = "TypeC"
)
,
"Maroon", "Transparent")
, "Transparent")
What I would like to do is add a Like type statement somewhere in this line, which would say ...and location LIKE "Scan" - in other words, a location with "Scan" somewhere in the title. locationName is a field i display in the report as well.
(
FormatPercent(Sum(Fields!numberOfIssues.Value)/First(Fields!totalItems.Value),3) >= .0001 & "%"
And ( First(Fields!errorType.Value) = "TypeA")
)
The like statement would be something similar to:
... And ( First(Fields!errorType.Value) = "TypeA") And First(Fields!locationName.Value) Like "*Scan*"
but that doesn't work. I've also tried:
And ( First(Fields!errorType.Value) = "TypeA" And First(Fields!locationName.Value.ToString().Contains("Scan")
Which doesn't work either.
Any way I can do this in an SSRS 2005 expression?
Thanks!