Do you know to embed an RS report in ASP.NET page the right way (using Report Viewer instead of IFrame)?
Last updated by Jeoffrey Fischer [SSW] 4 months ago.See history This rule has been archived
Archived Reason: WebForms is three technologies behind - WebForms, then MVC, then .NET Core with Controllers, then .NET Core with minimal APIs
Warning: This rule is obsolete and has been replaced with Do you know the best way to do printable reports?
Visual Studio provides a Report Viewer control for WebForms, so use it instead of the old IFrame method. The report viewer control is super easy to use - just drag the control into your page designer and select the properties you like.
The bad old way was to use an IFrame and point it to the report's URL (including parameters). This is bad because you might encounter a typing error. If you want to disable vertical scrollbar, you need to adjust the height of IFrame manually. Furthermore, you can't configure the report's authentication separately.
<IFRAME width="100%" height="700" TITLE="Report" src="http://reports.internal.ssw.com.au/ReportServer?
%2fTimeProOnlineReports%2fClientRegisteredProductsByDate
&rs:Command=Render&ClientContactID=<%=mintClientContactID%>&ClientExInfo=<%=clientInfo%>&rc:Parameters=false">
</IFRAME>
Bad Example - Embed report using IFrame
<rsweb:ReportViewer ID="ReportViewer1" runat="server" SizeToReportContent="True" ProcessingMode="Remote" Width="100%" AsyncRendering="false">
<ServerReport ReportServerUrl="http://reports.internal.ssw.com.au/reportserver"
ReportPath="/TimeProOnlineReports/ClientRegisteredProductsByDate" />
</rsweb:ReportViewer>
Good Example - Embed report using Report Viewer