是否有一种快速方法可以为 SQL Server Report Services RDLC 报告中的多行设置可见性表达式? [英] Is there a quick way to set a visiblity expression for many rows in a SQL Server Report Services RDLC report?

查看:50
本文介绍了是否有一种快速方法可以为 SQL Server Report Services RDLC 报告中的多行设置可见性表达式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多表(tablixes?)的报告,我需要在其中隐藏第二列中没有值的所有行:

I have a report with many tables (tablixes?), in which I need to hide all rows that don't have a value in the 2nd column:

我可以通过右键单击每一行来做到这一点

I can do this by right clicking on each row

并为行的可见性设置一个表达式,该表达式取决于出现在第二列字段中的值,例如

and setting an expression for the visibility of the row that depends on a value appearing in the field of the 2nd column, e.g.

=IIF((Fields!MyField4.Value = ""), True, False)

但问题是我的报告有超过 1000 行!鉴于每个字段都有一个特定的名称,这将需要很长时间!我可以修改 Xml,但这也需要一段时间.我目前正在编写一些使用 XDocument 的代码来实现这一点.

But the problem is that my report has over 1000 of these rows! It will take a very long time given that each field has a specific name! I can modify the Xml, but this will also take a while. I am currently writing some code, which uses XDocument, to achieve this.

有没有任何人能想到的更快的方法?也许是设计师的东西,或者一些 VB 代码?互联网上的任何地方似乎都建议一次右键单击一行.

Are there any faster ways that anyone can think of? Maybe something from the designer, or some VB code? Everywhere on the internet seems to suggest right clicking one row at a time.

推荐答案

在设计器中,选择所有行(使用 Shift 或 Ctrl 键),然后使用 VS/BIDS 中的属性"窗格一次性更改它们.那里有一个 Hidden 属性,您可以从其中的下拉列表中选择 Expression.从那里,您可以将 IIF 应用于所有行.

In the Designer, select all of the rows (using your Shift or Ctrl key), and use the Properties pane in VS/BIDS to change them all at once. There is a Hidden property there, and you can choose Expression from the dropdown in it. From there, you can apply the IIF to all rows.

当然,我假设所有可见性都基于每一行完全相同的表达式.如果没有,那么答案是否定的.除非您想开始在 RDL XML 中进行一些复制/粘贴操作,我不建议这样做.

Of course, I am assuming all of the visibility is based on the exact same expression for each row. If not, then the answer is no. Unless, you want to start doing some copy/paste stuff in the RDL XML, which I do not recommend.

这篇关于是否有一种快速方法可以为 SQL Server Report Services RDLC 报告中的多行设置可见性表达式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆