Telerik Reporting R1 2017

Deploying Web ReportViewer in SharePoint

Note Note

This is a legacy report viewer and for new projects our recommendation is to use the latest web forms report viewer - HTML5 Web Forms Report Viewer

This topic outlines the required steps that need to be taken to deploy the web ReportViewer prior to implementing it within an existing MOSS web site.

  1. First you need to install Telerik.Reporting.dll and Telerik.ReportViewer.WebForms.dll in the GAC (Global Assembly Cache) of your SharePoint server. For more information please refer to How to: Install an Assembly into the Global Assembly Cache article.
  2. Next you should tell SharePoint that the Reporting assemblies are safe to use. To do so you should add a few <SafeControl> entries within the <SafeControls> section of your web.config:
    <SafeControl Assembly="Telerik.Reporting, Version=x.x.x.xxxx, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.Reporting" TypeName="*" Safe="True" />
    <SafeControl Assembly="Telerik.ReportViewer.WebForms, Version=x.x.x.xxxx, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer" TypeName="*" Safe="True" />
  3. In order for the report viewer to function properly, you need to register its handler in the <system.web>\<httpHandlers> section in the web.config:
    <add path="Telerik.ReportViewer.axd" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=x.x.x.x, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" verb="*" validate="true" />

    When the application is hosted on IIS 7+, the handler of the report viewer should be registered in the <system.webServer>\<handlers> section as well:

    <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=x.x.x.x, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode" />

  4. Open the page where you want to add the ReportViewer control (e.g. e.g. default.master) and if prompted to check out the file select “Yes”. Now you need to register the Telerik.ReportViewer.WebForms assembly in the master page. Do so by adding the following directive:
    ASP.NET
    <%@ Register TagPrefix="telerik" Namespace="Telerik.ReportViewer.WebForms"
        Assembly="Telerik.ReportViewer.WebForms, Version=x.x.x.xxxx, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" %>
    Note Note
    Note that the version of an assembly is specified in each <SafeControl> tag. Make sure that you input the correct version you use before proceeding.
    Note Note
    The ReportViewer uses the session state to preserve the report instance assigned to its Report property during page postbacks and for some other design reasons as well. Thus have in mind that you should enable session state on your SharePoint server.

See Also