[Serializable] public class MyReportServerConnection : IReportServerConnection2 { public Uri ReportServerUrl { get { string url = "http://localhost/ReportServer/ReportService2010.asmx"; if (string.IsNullOrEmpty(url)) throw new Exception("Missing url from the Web.config file"); return new Uri(url); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { DoBind(); } if (!Page.IsPostBack && Request.QueryString.Count > 0) { string reportPath = Request.QueryString[0]; this.ReportLabel.Text = Request.QueryString[0]; //this.ReportViewer1.ProcessingMode = ProcessingMode.Remote; MyReportServerConnection rsc = new MyReportServerConnection(); this.ReportViewer1.ServerReport.ReportServerCredentials = rsc; //pathhardcoded for test this.ReportViewer1.ServerReport.ReportPath = "/report1"; this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(("http://localhost/ReportServer/")); this.ReportViewer1.ServerReport.Refresh(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)