Search code examples
reporting-services

If field is NOT null, then hide an object (SSRS Expression)


I have a rectangle.

I want to hide it if a field (X) is NOT NULL.

I tried this but it is not working:

=IIF(NOT IsNothing(Fields!filepath.Value), 1, 0)

I get the error:

An error occurred during local report processing.

The Hidden expression used in rectangle 'ID2398' returned a data type that is not valid.

Anyone know why I'm having this issue?

Do I need to place the actual field onto the report? I tried it but I keep getting the same error.


Solution

  • If you're using that for the Visibility expression, I believe you need to explicitly use True/False rather than 1 or 0. So try:

    =IIF(NOT IsNothing(Fields!filepath.Value), True, False)