[英]Compile time Error for Passing value from a TextBox to RDLC report
我想将文本框值传递给RDLC报告。 出于上述目的,我的代码是:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Reporting.WebForms;
using System.IO;
using System.Data.SqlClient;
using System.Configuration;
using System.Globalization;
ReportParameterCollection reportParameters = new ReportParameterCollection();
reportParameters.Add(new ReportParameter("ReportParameter1", t1.Text));
this.reportViewer2.LocalReport.SetParameters(reportParameters);
this.reportViewer2.RefreshReport();
但我在编译期间得到错误,即:
Error 15 The best overloaded method match for 'Microsoft.Reporting.WinForms.Report.SetParameters(System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>)' has some invalid arguments
Error 16 Argument 1: cannot convert from 'Microsoft.Reporting.WebForms.ReportParameterCollection' to 'System.Collections.Generic.IEnumerable<Microsoft.Reporting.WinForms.ReportParameter>'
以下行发生此错误:
this.reportViewer2.LocalReport.SetParameters(reportParameters);
需要帮助才能解决它。 提前致谢
我通过更换得到解决的错误Microsoft.Reporting.WebForms
与Microsoft.Reporting.WinForms
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.