简体   繁体   English

根据表格数据隐藏ssrs文本框

[英]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) 我可以通过在可见性表达式中使用此函数隐藏没有数据的表-= 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. 其中DataSet2是数据集的名称。 This is because you are now informing the expression to Count the Rows in DataSet2. 这是因为您现在正在通知表达式以对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 我不确定这是否适用于您的情况,但是我认为如果您不知道这种可能性,可以添加它以降低报告的复杂性可能会很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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