简体   繁体   中英

SSRS red squiggly line under visibility expression

I have a report where I want to hide certain elements based on a conditional expression. However, I'm getting the red squiggly line under the field even though I think it exists.

在此处输入图片说明

In this case, I want to hide the element if the HasQuotasGlobal field does not contain a 1. This particular dataset always has exactly one row, so I'm using the aggregate First() function, which contains the reference to the dataset context.

Can anyone tell me what is wrong with my expression?

I can confirm that it is not working as expected. The report runs, however the expression always evaluates to false, meaning that the element is displayed even when it should not.

Don't worry about the squiggly line. If there is a real Syntax Error the report will not be shown in preview, and you will get an error message instead. If you can see a preview, then the expression is valid.

To debug this problem, add a Textbox with the value you are testing in it

=First(Fields!HasQuotasGlobal.Value, "CountryData")

and another Textbox with the IIF too

=IIF(First(Fields!HasQuotasGlobal.Value, "CountryData") = 1, True, False)

Then you will know how the expression is being evaluated.

Remember that the visibility expression has TRUE = Hidden and FALSE = Visible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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