如何以编程方式为ReportViewer设置动态列 [英] How to programmatically set dynamic columns for ReportViewer

查看:87
本文介绍了如何以编程方式为ReportViewer设置动态列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我有一个带有2个参数的SP,日期和数字
内部是对报表的动态查询,直到日期参数和数字参数决定查询以2个不同的列集显示结果,并以相同的列集对列进行分组.
因此列号不是固定的.

我尝试为VB.Net Windows项目创建rdlc.我确实用存储过程创建了一个数据集,其中显示了参数,但未显示列名.
在rdlc中,我放了一个矩阵.但由于没有列,因此无法将数据集插入其中.
有谁有主意或有什么解决方法?
还是我需要更改其中的任何内容??请让我知道...

在此先感谢!!

HI All !
I have a SP with 2 parameters, a date & Number
Inside is a dynamic query for a report till tht Date parameter and the number parameter will decide the query to display the result with 2 different sets of columns and also groups the columns with the same set of columns.
So the columns numbers are not fixed.

I tried creating rdlc for a VB.Net windows project. i did created a dataset with tht stored procedure, Where the parameters are shown and the columns names are not displayed.
In rdlc i dropped a matrix. but unable to insert the dataset to it as no columns are with it.
do any one have idea or does it have any work around ?
or am i need to change any of things in it?? plz do let me know ...

Thanks in advance !!

推荐答案

为每个数据集定义2个rdlc文件.读取SP返回的列的列表.以编程方式更改ReportEmbeddedResource属性,如下所示:
Define 2 rdlc files for each dataset. Read list of columns returned by SP. Programmatically change ReportEmbeddedResource property, like this:
reportViewer1.LocalReport.ReportEmbeddedResource = "Report1.rdlc"


有关更多信息,请访问:动态分配reportviewer rdlc [


More at: dynamically assign reportviewer rdlc[^]


这篇关于如何以编程方式为ReportViewer设置动态列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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