SQL Server Show wanted string when get an specific value from Datasource - SRRS SQL Reporting Services Report Builder

klr1opcd  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(95)

using SQL Reporting Services Report Builder and this code:

=IIf((Fields!Login_de_Windows.Value = "0"), True,False)

I hide the result value when I get zero (note: the zero is string type, not numeric).

But I would like to show this: "---" (3 dashes) instead nothing when I get "0" as value

7y4bm7vi

7y4bm7vi1#

Assuming your value expression is something like this

=Fields!Login_de_Windows.Value

then you just need to change it to something like this.

=IIF(
     Fields!Login_de_Windows.Value = "0",
     "---",
     Fields!Login_de_Windows.Value 
     )

If this doesn't work, then all we are doing is testing the value of the current expression (whatever that is and returning -- if it is "0" . so the basic syntax is

=IIF(<<current textbox expressions here>> = "0", "---", <<current textbox expressions here>>)

相关问题