SSRS - Unable to Hide Rectangle with CountRows Expression

Underwood 1 Reputation point


I'm trying to hide a rectangle based off on how many rows exist in a dataset but it's indicating that the Hidden Expression has an error. I know it's complaining about security permissions, but I'm pretty sure that is a false flag since the exact same expression works without a problem inside of a text box. The expression I'm trying to use is: "=IIF(CountRows("Q_PRODUCTS")>5, False, True)", has anyone else had the same error message?


SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,131 questions
No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Underwood 1 Reputation point

    One other weird behavior I've noticed is that this error message does not appear if there exists a tablix on the page with the same dataset (q_products) for some reason, but I don't want a tablix in the middle of a page just to hide a rectangle.

    No comments

  2. ZoeHui-MSFT 18,896 Reputation points Microsoft Employee


    I did some local test with the expression you mentioned, however I couldn't reproduce your issue.

    I assumed it is related with the value of the dataset.

    I searched online and the issue occurs when they are using ASP.NET.

    Someone also said that when the value is NULL,the error occurs.

    You may try like this:

    =IIF(isnothing("Q_PRODUCTS") or CountRows("Q_PRODUCTS")>5, False, True)

    For reference:

    Hope this helps!

    If you have any question, please feel free to let me know.

    If your problem has been solved, please mark "accepted answer" on my reply, thank you for your understanding.



  3. Farhan Ahmed 1 Reputation point

    Its a weird error but you can try to run SSRS Report builder as "Run As Administrator" and see if this error exists.

    No comments