使用rdlc生成动态报告 [英] Generate dynamic report using rdlc

查看:77
本文介绍了使用rdlc生成动态报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如何使用MSReport(rdlc)创建动态列报表.例如,我有一个带有n列的数据表.我需要为应用程序用户提供column choosable选项,以使该列可见或在运行时隐藏该列,例如gridview的工作方式.还是我们可以发送布尔值来隐藏或显示在rdlc中使用数据源创建的列.

Hi everybody,

how to create a dynamic column report using MSReport(rdlc). For instance I have a datatable with n columns. I need to give the column choosable option to the application user to make visible the column or to hide the column in runtime like how the gridview is working. Or can we send the boolean value to hide or visible the column created in rdlc with datasource.

推荐答案

hi Shiva,
您可以通过将参数传递到报表中来轻松实现此目标.
例如,我有一个名为国家/地区代码"的列
我将通过参数报告,说CountryVisible
在该参数中,我将传递true或false

好吧,所有这些都是您将为报告编写的代码的一部分

在报告结尾处,选择表的一列,然后右键单击它并选择可见性.
然后转到表达式并输入
= iif(Parameters!CountryVisible.Value ="True",true,false)
hi Shiva,
You can achieve this easily by passing parameters to your report.
for example I have a column named Country code
I will pass parameter to report let say CountryVisible
in that parameter I will pass true or false

Well all this is a part of code you will be writing for your report

At report end you select a column of you table and right click on it and select visibility.
Then go to expression and type
=iif(Parameters!CountryVisible.Value="True",true,false)


最后我找到了它.我只是向报告发送一个布尔参数(isVisible).我在列可见性隐藏"属性表达式中使用了以下表达式

= Parameters!isVisible.Value
Finally i found it. i just send a Boolean parameter (isVisible) to the report. I used the following expression in column visibility "Hidden" property expression

=Parameters!isVisible.Value


那是我对你说的..
布尔类型的值是true和false
that what i said to you ..
true and false were the bool type values


这篇关于使用rdlc生成动态报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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