将新参数传递给rdlc报告 [英] Passing new parameters to rdlc reports

查看:74
本文介绍了将新参数传递给rdlc报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我已经使用"向导"在VB.Net中成功地制作了一个简单的报告(.rdlc)。 Visual Team Suite。

现在,有没有人可以帮助我将新参数传递给报告?

例如,我有一个报告显示公司的所有交易。现在,我需要知道的是,如果用户只想查看2006年1月1日至2006年1月5日期间的数据等特定数据,我将如何将新参数传递给报告?

谢谢!! :)

Hi guys, ive sucessfully made a simple report(.rdlc) in VB.Net using the "wizard" of Visual Team Suite.

Now, is there anyone here who could help me pass a new parameter to the report?

For example, i have a report that shows ALL the transaction of a company. Now, what need I need to know is how will I pass a new parameter to the report if the user only wants to view certain data like data from a Jan. 1, 2006 to Jan. 5, 2006?

Thanks!! :)

推荐答案

这段代码对我有用:

This code worked for me:

 

 

ReportParameter []
参数=

ReportParameter [3];

ReportParameter[] parameters = new ReportParameter[3];

参数[0] =

  ;

new
ReportParameter " ReportTitle"
"事件列表报告" );

new ReportParameter("ReportTitle", "Incident List Report");

参数[1] =

 

new
ReportParameter " StartDate"
txtStartDate.Text);

new ReportParameter("StartDate", txtStartDate.Text);

参数[2] =

 

new
ReportParameter " EndDate"
txtEndDate.Text);

new ReportParameter("EndDate", txtEndDate.Text);

ReportViewer1.LocalReport.SetParameters(parameters);

ReportViewer1.LocalReport.SetParameters(parameters);

ReportViewer1.LocalReport.Refresh();

ReportViewer1.LocalReport.Refresh();


这篇关于将新参数传递给rdlc报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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