简体   繁体   English

SSRS行可见性表达式中的LIKE运算符

[英]LIKE operator in SSRS row visibility expression

I have a text box within an rdl report which I want to suppress based on certain terms in my dataset (ie if the query returns a term which ends with the letter "L" then hide the text box). 我在rdl报表中有一个文本框,我想根据数据集中的某些术语来取消显示(即,如果查询返回的结果以字母“ L”结尾,则隐藏该文本框)。

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" “文本框的Visibility.Hidden表达式包含错误:[BC30201]期望的表达式”

It seems like a schoolboy error but I have tried various permutations on this expression with no luck. 似乎是一个小学生错误,但我尝试过对该表达式进行各种排列,但是没有运气。 Any help would be appreciated. 任何帮助,将不胜感激。

SSRS expressions are funny in some ways. SSRS表达式在某些方面很有趣。 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. 要点是SSRS不使用SQL语法。 It's VB 是VB

I think you could use the Right() function which returns a specified number of characters from the right hand side of a string. 我认为您可以使用Right()函数,该函数从字符串的右侧返回指定数量的字符。

Eg 例如

=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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM