I’m having a problem with the ASP.NET version of the ReportViewer control for SSRS.
In my ASP.NET web forms file I have:
<rsweb:ReportViewer ID="webViewer" runat="server" Width="100%" Height="100%"
ProcessingMode="Remote">
<ServerReport ReportPath="/AnalyticReports/SiteOverview"
ReportServerUrl="http://someserver/ssrs" />
</rsweb:ReportViewer>
This works fine and dandy as expected.
However, say I want to change the server and report path programmatically. How would I do that?
I tried this:
webViewer.ServerReport.ReportServerUrl = new Uri("http://someserver/ssrs");
webViewer.ServerReport.ReportPath = "/AnalyticReports/SiteOverview";
webViewer.ServerReport.Refresh();
However that doesn’t seem to do anything. I even tried adding a webViewer.Reset() but to no avail.
Anyone point me in the right direction?
Actually, it seems that the problem lies with the
Page_Loadevent. After coming across http://msdn.microsoft.com/en-us/library/aa337091.aspx I triedPage_Initand things seem to work as expected.