none
SSRS 2008 & VS2010 - The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form

    Question

  • Hi

    I am trying to embed my SSRS2008 reports into my .net 4.0 application. I am using the following code on my webform...

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
            ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://armstrong-svr/reportserver")
            ReportViewer1.ServerReport.ReportPath = "/Intranet Reports/license expiry"
        End Sub

    Loading the webform returns the error 'The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form'. I am fairly new to .net development and i am unsure what the script manager actually is. If any one could point me in the right direction here it would be much appreciated. Full error details below. Many thanks.

    Steve


    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Microsoft.Reporting.WebForms.ScriptManagerNotFoundException: The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form.

    Source Error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. 

    Stack Trace:


    [ScriptManagerNotFoundException: The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form.]
       Microsoft.Reporting.WebForms.ReportViewer.CreateChildControls() +212
       System.Web.UI.Control.EnsureChildControls() +102
       System.Web.UI.Control.PreRenderRecursiveInternal() +42
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8387
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
       System.Web.UI.Page.ProcessRequest() +78
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.webform1_aspx.ProcessRequest(HttpContext context) +37
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    Tuesday, July 13, 2010 9:08 AM

Answers

  • Hi Steve,

    Adding a script manager to the page is easy to do.  Open up your webform (*.aspx file) in visual studio and then go to the toolbox and drag a script manager onto your page.  It should be in the toolbox inside the AJAX Extensions tab.  Doing this will add the following code to your aspx file:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    

    Adding a script manager to the page means that the page will automatically include the necessary javascript files to make the report control work in the browser correctly.

    See this link for more information:

    http://msdn.microsoft.com/en-us/library/ms252123.aspx

    Cheers,

    Tim

    • Marked as answer by Steve_Flynn Tuesday, July 13, 2010 3:05 PM
    Tuesday, July 13, 2010 11:09 AM

All replies

  • Hi Steve,

    Adding a script manager to the page is easy to do.  Open up your webform (*.aspx file) in visual studio and then go to the toolbox and drag a script manager onto your page.  It should be in the toolbox inside the AJAX Extensions tab.  Doing this will add the following code to your aspx file:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    

    Adding a script manager to the page means that the page will automatically include the necessary javascript files to make the report control work in the browser correctly.

    See this link for more information:

    http://msdn.microsoft.com/en-us/library/ms252123.aspx

    Cheers,

    Tim

    • Marked as answer by Steve_Flynn Tuesday, July 13, 2010 3:05 PM
    Tuesday, July 13, 2010 11:09 AM
  • Thanks Tim

    This has gotten me a step closer. Unfortunately, the report still isn't working, i now get the following error...

    The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.
    The request failed with HTTP status 404: Not Found.

    Probably best i post this a seperate thread. Thanks again.

    Tuesday, July 13, 2010 3:04 PM
  • ADD following tag to your ASPX page inside the <form></form> tag

    <form>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    </form

    and must not forget to IsPostBack to your Page_load Event to avoid  infinite looping

    if(!IsPostBack)
    {
    //
    }

    http://oops-solution.blogspot.com/
    Monday, October 24, 2011 9:34 AM
  • I'm getting to the same spot as Steve.

    1) I have the Report Viewer Control on the Web From. 
    2) I have the script manager object beside the Report Viewer Control.
    3) Code Behind on the .aspx form looks like this:

    public partial class CallRemoteReport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e) 
        {
            if (!IsPostBack)
            {
                ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/Reports"); //Path to sever
                ReportViewer1.ServerReport.ReportPath = "/conditional_linking"; //name of the report (there are no parameters)
                ReportViewer1.ServerReport.Refresh(); 
            }     
        }

    }

    But i'm also receiving the error in Internet Explorer:

    • The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.
      • The request failed with HTTP status 404: Not Found.  

    Any additional information on why is error is being generated is greatly appreciated. Does ASP.Net need to be explicitly granted access to the report server or something like that?
    Thanks in Advance! Carl


    Carl

    Saturday, April 28, 2012 5:44 PM
  • Nevermind - I found the answer to my question here: http://s226.codeinspot.com/q/1014685

    I was also using the report manager url instead of the report server url!


    Carl

    Saturday, April 28, 2012 9:24 PM
  •  thank u so much Spoida  u save a lot of time :)

    Tuesday, November 27, 2012 7:30 AM