1
votes

I have a text box within an rdl report which I want to suppress based on certain terms in my dataset (i.e. if the query returns a term which ends with the letter "L" then hide the text box).

Within the textbox properties I have set visibility expression for Hidden with the below expression:

=First(Fields!STERMS__.Value, "Job") NOT LIKE '%L'

When I run it I get the error:

"The Visibility.Hidden expression for the text box contains an error: [BC30201] Expression expected"

It seems like a schoolboy error but I have tried various permutations on this expression with no luck. Any help would be appreciated.

2

2 Answers

2
votes

SSRS expressions are funny in some ways. I think what you're looking for is:

=IIf(First(Fields!STERMS__.Value, "Job") Like "*L", True, False)

The gist is that SSRS doesn't use SQL syntax. It's VB

0
votes

I think you could use the Right() function which returns a specified number of characters from the right hand side of a string.

E.g.

=Right(Fields!STERMS__.Value,1)

I guess in your case for Hidden property on the cell, the expression would look like this

=IIF(Right(First(Fields!STERMS__.Value, "Job"),1)=="L",true,false)