在 RDLC 报告中动态隐藏列
我们如何在 MVC 2 的 rdlc 报告中动态隐藏列?
是否可以使用外部参数?我们如何以编程方式控制 rdlc 报告中列的可见性?
How we can hide columns dynamically in rdlc reports in MVC 2?
Is it is possible using external parameters? How we can programmatically control the visibility of columns in rdlc reports?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您不想使用
Hidden
属性,您实际上想要选择该列,右键单击并选择Column Visibility
。进入此处后,您可以使用表达式根据参数设置可见性,如下所示:Hidden
在此实例中不起作用,因为您实际上并未将其应用到像您这样的对象当您选择文本框之类的内容时。You don't want to use the
Hidden
property, you actually want to select the column, Right Click and selectColumn Visibility
. Once in here you can use an expression to set the visibility based on a parameter, something like this:Hidden
doesn't work in this instance because you're not actually applying it to an object like you are when you select something like a textbox.以下是隐藏列的步骤
1) 在报告中添加名为“column_visible”的布尔参数
2) 右键单击所需列并选择“列可见性”。
3) 选择“根据表达式显示或隐藏”选项
4) 添加以下公式
5) 在 c# 文件中添加以下代码,在其中为上述添加的参数赋值
Following are the steps to hide the column
1) Add a boolean parameter with name column_visible in your report
2) Right Click on desired column and select Column Visibility.
3) Select the option "show or hide based on an expression"
4) add following formula
5) Add following code in c# file where you are assigning value to above added parameter
选择一列。在属性中,您有
隐藏
。财产。然后您可以设置一个条件,例如=Parameters!IsColumnHidden.Value
。如果您想从 C# 代码执行此操作,我会向报告发送一个参数(如上所示),说明是否应隐藏列。
Select a column. In properties you have
Hidden
. property. Then you can set a condition, for example=Parameters!IsColumnHidden.Value
.If you want to do this from C# code I would send a parameter (like above) to the report saying if column should be hidden.