如何在 RDLC 中设置参数值 [英] How to set parameter values in RDLC

查看:34
本文介绍了如何在 RDLC 中设置参数值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为报告中的日期范围添加了两个文本框.为了填充文本框中的值,我为文本框设置了参数.

I have added two text boxes for the date range in the report. To fill the values in the text boxes, I set parameters to the text boxes.

现在日期范围来自一个名为 DateRange 的表单,它有两个 DateTimePickers.

Now the date range is coming from a form named DateRange having two DateTimePickers.

如何设置rdlc中文本框的值等于这些DataTimePickers?

How to set the value of the text boxes in rdlc equal to these DataTimePickers?

推荐答案

您可以像这样设置参数值.

You can set parameter value like this.

DateTime dtStartDate = dateTimePicker1.Value;     
DateTime dtEndDate = dateTimePicker2.Value;     
ReportParameter[] params = new ReportParameter[2]; 
params[0] = new ReportParameter("StartDate", dtStartDate, false); 
params[1] = new ReportParameter("EndDate", dtEndDate, false); 
this.ReportViewer1.ServerReport.SetParameters(params);

将参数传递给 RDLC

这篇关于如何在 RDLC 中设置参数值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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