将多参数从查询字符串传递到rdlc报告 [英] Passing multiparameter from querystring to rdlc report
本文介绍了将多参数从查询字符串传递到rdlc报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个网页
第一页有一个按钮,点击哪个第二页被调用,其中包含rdlc报告
首页
string vendors = & Id = 7& Id = 35;
受保护 void Page_Load(对象发件人,EventArgs e)
{
}
受保护 void Button1_Click( object sender,EventArgs e)
{
Response.Redirect( WebForm1.aspx? +供应商);
}
这里Id是多参数值
< br $>
Page 2
string str = Request.QueryString [Id ];
ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource
(dsReport,SqlDataSource1));
列表< ReportParameter > parameters = new List < ReportParameter > < /跨度>();
parameters.Add(new ReportParameter(Id,str));
ReportViewer1.LocalReport.SetParameters(参数);
这给了我oracle错误(ORA-01722:无效数字)。请帮助
解决方案
当您尝试将字符串转换为数字时,会发生ORA-01722错误,并且该字符串无法转换为数字。
I have two webpages
First page has a button on clicking which second page is called which contains rdlc report
First Page
string vendors = "&Id=7&Id=35";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("WebForm1.aspx?"+vendors );
}
Here Id is multiparameter value
Page Two
string str = Request.QueryString["Id"];
ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource
("dsReport", SqlDataSource1));
List<ReportParameter> parameters = new List<ReportParameter>();
parameters.Add(new ReportParameter("Id", str));
ReportViewer1.LocalReport.SetParameters(parameters);
This gives me oracle error(ORA-01722: invalid number ). Pls Help
解决方案
An ORA-01722 error occurs when you try to convert a character string into a number, and the string cannot be converted into a number.
这篇关于将多参数从查询字符串传递到rdlc报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文