Skip to content

How can I get RequestReduce to work with ReportViewer Controls?

mwrock edited this page Jan 17, 2012 · 2 revisions

RequestReduce can bundle and minify scripts used to render SSRS ReportViewer controls, but some special configuration is needed. If you do not make the changes below, you will receive javascript errors when your ReportViewer is rendered.

First: You need to add Reserved.ReportViewerWebControl.axd to the javascriptUrlsToIgnore setting in your <RequestReduce /> configuration in web.config. At a minimum it will look like this:

<RequestReduce javascriptUrlsToIgnore="Reserved.ReportViewerWebControl.axd" />

Second: You need to change the webform where the ReportViewer control is hosted and set the AjaxFrameworkMode of its ScriptManager control to "Explicit" and then explicitly add all the MS Ajax scripts required by the ReportViewer. Your ScriptManager control will look like this:

<asp:ScriptManager ID="ScriptManager1" AjaxFrameworkMode="Explicit" runat="server">
    <Scripts>
        <asp:ScriptReference Name="MicrosoftAjaxCore.js" /> 
        <asp:ScriptReference Name="MicrosoftAjaxComponentModel.js" />  
        <asp:ScriptReference Name="MicrosoftAjaxSerialization.js" /> 
        <asp:ScriptReference Name="MicrosoftAjaxNetwork.js" /> 
        <asp:ScriptReference Name="MicrosoftAjaxTimer.js" /> 
        <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 
    </Scripts>
</asp:ScriptManager>

Although now the actual ReportViewer control will not be included in the bundling, the several other scripts that it brings along with it can be bundled.

Clone this wiki locally