在运行时在rdlc报告中显示/隐藏列 [英] show/hide columns in rdlc report at runtime

查看:124
本文介绍了在运行时在rdlc报告中显示/隐藏列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想创建一个带有动态列的rdlc报告.我的意思是我想让用户选择他想在报告中查看的列.我的数据也在数据表中.

我该怎么办?

Hi all,

I want to create a rdlc report with dynamic columns.I mean i want to let user to select columns that he want to view in his report.also my data is in a datatable.

how can i do that?
Is there an easier way if i use Crystal Report?

推荐答案

其中一种方法如下:
a)添加数据集并设计具有所有必需列的RDLC报告
b)每个动态列添加一个报表布尔参数
c)在rdlc设计模式下右键单击列,然后选择列可见性"
-选择基于表达式显示或隐藏",然后选择报告参数
d)在后面的代码中,使用ReportViewer.LocaReport.SetParameters方法设置布尔参数值,"true"隐藏,"false"显示.

看看是否有帮助.
One of the approaches is as follows:
a) Add the dataset and design the RDLC report with all required columns
b) Add one report boolean parameter per dynamic column
c) Right click on column in rdlc design mode and select Column Visibility
- Select "Show or Hide based on an expression" and select the report parameter
d) In code behind, use ReportViewer.LocaReport.SetParameters method to set the boolean parameter values, "true" to hide and "false" to show.

See if this helps.


这篇关于在运行时在rdlc报告中显示/隐藏列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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