从RDLC本地报告C#中检索参数 [英] Retrieve Parameters From RDLC Local Report C#

查看:144
本文介绍了从RDLC本地报告C#中检索参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从RDLC本地报告中检索报告参数



How to retrieve the report parameters from the RDLC local report

LocalReport localReport = (LocalReport)e.Report;
                ReportParameterInfoCollection ps = new ReportParameterInfoCollection();
                ps = localReport.GetParameters();
                ReportParameter paramV = new ReportParameter();





I想要在paramV中保存一个特定参数及其值



I want to save a specific parameter with its value in the "paramV"

推荐答案

我得到了另一个更简单的解决方案:



I got another easier solution:

ReportParameterInfoCollection ps;
 ps = localReport.GetParameters();
 ReportParameter paramV = new ReportParameter();
 foreach (ReportParameterInfo p in ps)
 {
     if (p.Name == "Quart")
     {
         paramV.Name = p.Name;
         paramV.Values.Add(p.Values[0]);
     }
 }


这篇关于从RDLC本地报告C#中检索参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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