【发布时间】:2018-05-22 10:55:47
【问题描述】:
我正在尝试将参数从一页传递到另一页。我在另一页上使用CrystalReportViewer。
有CrystalReportViewer1_Init(object sender, EventArgs e)函数,在那里我应该收到上一页的filename
这是我的代码
protected void CrystalReportViewer1_Init(object sender, EventArgs e)
{
ReportDocument _rdStudents = new ReportDocument();
string reportPath = Server.MapPath("~/CrystalReportFiles/Inventory/" + Request.QueryString[" filename "].ToString());
//string reportPath = Server.MapPath("~/CrystalReportFiles/Inventory/WeightBarcorde.rpt"); This code is working
_rdStudents.Load(reportPath);
CrystalReportViewer1.ReportSource = _rdStudents;
}
这是我的参数http://localhost:55047/CrytalReportTest.aspx?filename=WeightBarcorde.rpt
<a target="_blank" href="CrytalReportTest.aspx?filename=WeightBarcorde.rpt">WeightBarcorde.rpt</a>
我们可以在init函数中传递参数吗?或者我的代码有什么问题
【问题讨论】:
标签: c# parameters query-string crystal-reports-viewer