SSRS - Unable to Hide Rectangle with CountRows Expression

Underwood 1 Reputation point
2020-09-02T22:28:22.257+00:00

Greetings!

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?

22309-image.png

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,878 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Underwood 1 Reputation point
    2020-09-02T22:33:25.543+00:00

    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.

    0 comments No comments

  2. ZoeHui-MSFT 35,556 Reputation points
    2020-09-03T03:27:30.903+00:00

    Hi

    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:https://stackoverflow.com/questions/1097485/ssrs-08-system-security-permissions-securitypermission-error

    https://forums.asp.net/t/1809122.aspx?The+Hidden+expression+for+the+tablix+Details9+contains+an+error

    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.

    Regards,

    Zoe


  3. Farhan Ahmed 1 Reputation point
    2020-09-07T10:11:06.817+00:00

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

    0 comments No comments