我试图调用在 SSRS 中创建的 .rdl 报告以在 aspx 页面中调用;但我收到以下错误:
报表查看器 Web 控件需要一个
System.Web.UI.ScriptManager
在线表单
我的代码如下,
protected void Page_Load(object sender, EventArgs e)
{
//string query = Session["ClosedBugsResult1"].ToString();
if(!IsPostBack)
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver");
ReportViewer1.ServerReport.ReportPath = @"D:\Users\XXX\Documents\Visual Studio 2008\Projects\BugtrackerSample1\BugTrackerSample\BugTrackerSample\Report1.rdl";
//ReportParameter[] param = new ReportParameter[1];
//param[0] = new ReportParameter("CustomerID", txtparam.Text);
//ReportViewer1.ServerReport.SetParameters(param);
System.Web.UI.ScriptManager scriptManager = new ScriptManager();
Page page = new Page();
System.Web.UI.HtmlControls.HtmlForm form = new HtmlForm();
form.Controls.Add(scriptManager);
form.Controls.Add(ReportViewer1);
page.Controls.Add(form);
page.DataBind(); //exception here
ReportViewer1.ServerReport.Refresh();
}
任何帮助表示赞赏。