Ajax client side errors when using the ReportViewer 10 control to run a local report in a VS2010 MVC project RRS feed

  • Question

  • Hi,

    We have an MVC project that we recently upgraded from VS2008 (which used the ReportViewer 9 control) to VS2010 (targeting the 3.5 Framework for the moment, though that probably makes no difference to my problem). The reports run fine in VS2010 after the upgrade, but we'd like to edit the report definitions in VS2010 to make some changes. To open the reports in VS2010, it needs to upgrade them first - from SSRS 2005 to SSRS 2008 format.

    That causes the ReportViewer 9 control to not like the report definition, so I have followed Brian Hartman's instructions (http://blogs.msdn.com/b/brianhartman/archive/2010/06/07/upgrading-web-application-projects-to-vs-2010.aspx) to change the ReportViewer references from 9.0 to 10.0 and added a ScriptManager control to the same aspx page that the ReportViewer control is on (since the Report 10 control relies heavily on Ajax now).

    It's worth mentioning that our reports are processed in local mode (i.e. not server based - as they have an .RDLC file extension).

    The problem I have is that when the ReportViewer.aspx loads, it shows the ReportViewer toolbar, but then I get a few client side errors and the report content itself does not load. The errors, which look like Ajax errors, are as follows:-

    Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.
    Parameter name: instance

    Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
    Details: Error parsing near '

    I even see the ReportViewer "Loading..." popup window, so it's almost working.

    Is what we are trying to do - run local reports in an MVC application using the ReportViewer 10 control - possible ? I've seen an MS response to a similar kind of issue (https://connect.microsoft.com/VisualStudio/feedback/details/541486/paging-in-web-form-ssrs-report-viewer-does-not-work) that said "Visual Studio 2010 ReportViewer is designed to be a Webforms control and it is not supported with MVC out-of-the-box", but we are hosting the ReportViewer control on an aspx page and, besides, that approach works fine with ReportViewer 9, so it's the addition of the Ajax reliance for ReportViewer 10 that is causing us the issue.

    Maybe there is something missing (Ajax related?) in our web.config, although I have compared it to a “working” web.config for a normal web application (i.e. not MVC) and there doesn’t seem to be anything.

    I'm hoping someone can help and that we don't have to resort to using VS2008 to edit our report definitions. Many thanks in advance!

    Regards, Iain.

    Monday, August 2, 2010 12:07 PM

All replies

  • Hi,

    I am having the same problem. We have an MVC project and we are using version 9 of the report viewer control in an MVC view with no problems, however if we try and replace the control with version 10 we get errors in the client side script generated by the report viewer control.

    I have tried this in a new MVC project and get the same problem.. it appears version 10 of this control does not work with MVC.

    Does anyone from microsoft have a response on this please?



    Wednesday, September 29, 2010 11:30 AM
  • Any chance on some kind of response on this from MS please (I am thinking Brian Hartman)?

    Iain requested some information back at the start of August.

    Even if the response just says the report viewer 10 will not work under MVC it would at least clarify the situation.


    Thursday, September 30, 2010 10:52 AM
  • Officially, using the ReportViewer in MVC is not supported.  That is, it's not something we specifically test and we don't make any guarantees for it.

    That said, there may be ways to get the ReportViewer to work and we don't do anything specifically to prevent it.  For the error noted earlier on this thread, the underlying error does appear to a problem with ASP.Net AJAX parsing the response.  Often times this happens as the result of an exception being thrown on the server and the error page being sent back to the client rather than a properly formatted ASP.Net AJAX response.  Without seeing the error message, I can't really provide more insight into the underlying cause in this specific case.

    One potential workaround you may wish to try is to turn off asynchronous postbacks for the entire page.  You can do this with ScriptManager.EnablePartialRenderings property.

    Friday, October 1, 2010 12:35 AM
  • I have had the same problem with the reportviewer control on an ordinary web page when I moved from VS2008 to VS2010 and framework 4 which in fact delayed my move to VS2010.  The above solution worked for me. Curiously enough the report viewer specifically did not work on pages with master pages but did on ordinary web pages - if that is any help to someone who might concoct a proper solution. I did post this on http://forums.asp.net/t/1588693.aspx last August but got no response.  Thanks Brian for your help here and I have passed your solution to one other.
    Wednesday, January 5, 2011 3:04 PM
  • We are also moving our app to VS2010, framework 4, and MVC 3 and had issues with the report viewer control - actually we have had many issues with AJAX with other controls also. For us the solution was to set EnableEventValidation=false in the page declaration and in the report viewer control set the attribute AsyncRendering=false. We also created a separate master page for viewing the reports and removed any references to any of the AJAX libraries - the only references to js files that  we have in the master are to jquery-1.6.min.js and jquery-ui-1.8.custom.min.js.
    Thursday, December 8, 2011 3:53 PM
  • Does anybody have solution for this?
    Thursday, April 5, 2012 2:48 PM
  • I have the same issue...anyone fixed this?
    Saturday, June 9, 2012 3:17 PM
  • I have the same issue!!! does anyone have the solution for this?
    Thursday, November 1, 2012 11:48 PM