Share via


Using Report Viewer control in ASPX pages

If you’re developing a ASP.NET page and planning to use the Microsoft Report Viewer web control for showing reports that are deployed to SSRS prior to 2016, here is a word of recommendation for you.

Make sure the page that hosts the Report viewer control has the compatibility setting enabled as shown below:

You need to add this within the HEAD element of your page:

<meta http-equiv="X-UA-Compatible" content="IE=5">

The sample page would look like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html xmlns=" https://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="x-ua-compatible" content="IE=5">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana"
Font-Size="8pt" ProcessingMode="Remote" WaitMessageFont-Names="Verdana"
WaitMessageFont-Size="14pt">
<ServerReport ReportPath="/ReportTest" ReportServerUrl=
https://servername/reportserver />
</rsweb:ReportViewer>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

</div>
</form>
</body>
</html>

Make sure to keep an eye on the DOCTYPE as well as I've posted it on the above sample.

The above blog post is not applicable for the newer version of the Report Viewer control i.e. Report Viewer 2016.

For Report viewer control against SSRS 2016, the newer version of the control (2016) is available here. This would help you to leverage all the newer updates within SSRS 2016 including the print functionality.

HTH!

Selva.

[All the posts are AS-IS without any warranty]

Comments

  • Anonymous
    September 05, 2014
    Hi Selvar, Thanks for sharing! Could you enumerate the reasons why it needs to be set to IE5? Frederick

  • Anonymous
    September 08, 2014
    Hi Frederick, Yes, Reporting services still renders the reports in QUIRKS mode and it is yet to support the standards mode. Hence this element is a mandatory. Now i know the obvious question. When would it support the standards mode? :) This is still in the product roadmap but nothing official as of yet on when it would be available. HTH! Selva.