简体   繁体   中英

hide ssrs textbox based on table data

I can hide a table with no data by using this function in the visibility expression - = Iif(CountRows() > 0, false, true)

But I have a textbox used as a heading for the table. How do I hide the textbox if the table relating to it has no data?

Thanks

=iif(countRows("DataSet2") > 0, false, true)

Where DataSet2 is the name of your dataset. This is because you are now informing the expression to Count the Rows in DataSet2. As no rows exist, it is set to hidden.

Further information...

Is the heading for the table adjacent to the table? Are you aware you can add rows above a table to provide extra heading information?

For example you can Right Click the Row Header, Select Insert Row -> Above and a new Row appears. You can then merge the cells horizontally, and set a title for the table (for example)

Now when you set the table to be hidden, this header row is also hidden automatically.

在此处输入图片说明

I'm not sure this is applicable to your situation, but I thought it might be useful to add, to reduce the complexity of your report, if you were unaware of the possibility

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