我正在尝试将参数从一页传递到另一页。我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函数中传递参数吗?或我的代码有什么问题