Report Viewer control update now available
Thanks to Rhys Schmidtke, Senior Software Engineer, for contributing content to today’s post.
A few weeks ago, we published a Release Candidate of an updated Report Viewer control to NuGet, enabling you to embed paginated reports into your existing ASP.NET Web Forms apps and incorporating several enhancements we made for SSRS 2016, including modern browser support. Since then, many of you have tried the Release Candidate and shared your feedback. Today, we’re pleased to announce an updated Release Candidate for you to try.
What’s new in this update
With this update, the Report Viewer control
- Includes resource files for 14 supported languages
- Supports and renders properly on pages that use ASP.NET master pages
- Supports pages accessed over HTTPS
- Provides improved error messages in some common cases when the control might not be configured properly
First things first…
If you installed the previous Release Candidate into your app, you’ll need to first uninstall it. (You shouldn’t need to perform this step to update future releases, but you do this time.)
To uninstall the previous Release Candidate from your app,
- Open the packages.config file in your project and delete the <package> element for the Report Viewer control:
- Remove references to Microsoft.ReportViewer.* assemblies from your project:
Install the NuGet package
To install the Report Viewer control into your app,
- Open your ASP.NET Web Forms project in Visual Studio 2015.
- Open the NuGet Package Manager Console (Tools > NuGet Package Manager > Package Manager Console).
- Enter this command in the console:
That’s it; your project now has the files you need.
Add a Report Viewer control to your page
If your project doesn’t reference an earlier version of the Report Viewer control, you’re ready to add a Report Viewer control to your page. You’ll need to add
- A Register tag.
- A ScriptManager control.
- The ReportViewer control itself.
Your page will look something like the following:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=22.214.171.124, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<form id="form1" runat="server">
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Width="850px" Height="680px"> <ServerReport ReportServerUrl="https://your-report-server/reportserver" ReportPath="/Some Folder/Some Report" /> </rsweb:ReportViewer>
Just use your ReportServerUrl and ReportPath in place of the sample values above.
Check out this article for a step-by-step walkthrough.
Update an existing web app
If your existing project references a previous version of the Report Viewer control, you’ll need to update a few references in your web pages and web.config file; see this article for more info.
You might encounter a couple of known issues with this Release Candidate:
- If you have SQL Server Data Tools (SSDT) 16.5 or earlier installed, you may see an error at design time. (The Report Viewer control should work fine at runtime.) Upgrading to SSDT 17.0 or a future update should resolve this issue.
- If your ASP.NET page (or master page) uses jQuery, it may interfere with the Report Viewer control and some features, such as printing, may not work properly. Commenting out other references to jQuery should avoid this issue.
We aim to address these issues in a future update.