We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Report Viewer Microsoft JScript runtime error

Thread ID:

Created:

Updated:

Platform:

Replies:

107549 Mar 6,2013 11:48 PM UTC Mar 7,2013 10:26 AM UTC ASP.NET MVC (Classic) 1
loading
Tags: ReportViewer
Paul Hegel
Asked On March 6, 2013 11:48 PM UTC

I'm trying to implement the Asp.Net MVC ReportViewer and I've implemented the code several ways, but nothing ever seems to render.  Figured out debugging and now I'm getting this Javasript error:

Object doesn't support property or method 'sfReportViewer'

The highlight section of Javascript is failing:
<script type="text/javascript">
if(typeof jQuery!='undefined'){ $(function(){
var obj = $find('WatingPopup_MvcProReport'); if(obj!=null){ obj.dispose(); obj = null; }$create(Syncfusion.Shared.Mvc.WaitingPopup, {"EnableHTML5":false,"Shape":"SquaresCircle","ShapeColor":null,"ShapeHeight":"225","ShapeWidth":"300","autoDisplay":false,"backgroundColor":"0","imageUrl":null,"popID":"WatingPopup_MvcProReport","showImage":true,"targetId":"MvcProReport_reportsLoadingDiv","transparency":4}, null, null, $get("WatingPopup_MvcProReport"));
$("#MvcProReport").sfReportViewer({"ControlId":"MvcProReport_ec2bdfc3_fb98_4b1b_bf60_32764bb9cf18","CurrentPage":1,"Id":"MvcProReport","PrintMode":false,"RequestMapUrl":null,"ShowToolbar":true,"ZoomFactor":1});
})}
</script>

I'm using  MVC Razor and Report Server Path rather than an RDL see attached ReportViewerController.

This is the content of my index.cshtml file:
@{
    
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div style="width:100%;height:600px;">   
    @{Html.Syncfusion().ReportViewer("MvcProReport" ,(ReportViewerModel)ViewData["ReportModel"]).Render();}
</div>
   @{Html.Syncfusion().ScriptManager().Combine(true).Minify(true).Render();}

Please help!

Paul


ReportViewerController_585341e2.zip

Lingaraj S [Syncfusion]
Replied On March 7, 2013 10:26 AM UTC

Hi Paul,

 

Thanks you for your interest in Syncfusion products.

 

We have tested this issue at our end. But we dint face any issue with ReportViewer rendering. Please check the following items with MVC application to run the ReportViewer.

 

1.      Assemblies for MVC Application.

a.       Syncfusion.Core.

b.      Syncfusion.Shared.MVC.

c.       Syncfusion.Linq.Base.

d.      Syncfusion.ReportViewer.MVC.

2.      Assemblies information in WebConfig.

3.      Namespaces in WeConfig.

  <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Syncfusion.Core, Version=11.104.0.21, Culture=neutral, PublicKeyToken=632609B4D040F6B4"/>
        <add assembly="Syncfusion.Shared.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.Linq.Base, Version=11.104.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.ReportViewer.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89""/>
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="Syncfusion.Mvc.Shared"/>
        <add namespace="Syncfusion.ReportViewer.Mvc"/>
      </namespaces>
    </pages>

 

4.      Http handlers for  ReportViewer and Syncfusion Script Manager in Web config.

 <system.webServer>
    <handlers>
      <remove name="MvcResourceHandler"/>
      <add verb="GET,HEAD" name="MvcResourceHandler" path="MvcResourceHandler.axd" 
type="Syncfusion.Mvc.Shared.MvcResourceHandler, Syncfusion.Shared.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
      <add verb="*" path="syncfusion_generatereports.axd" name="syncfusion_generatereports" 
type="Syncfusion.ReportViewer.Mvc.ReportViewerHandler, Syncfusion.ReportViewer.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
    </handlers>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
  
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Syncfusion.Core, Version=11.104.0.21, Culture=neutral, PublicKeyToken=632609B4D040F6B4"/>
        <add assembly="Syncfusion.Shared.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.Linq.Base, Version=11.104.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
        <add assembly="Syncfusion.ReportViewer.Mvc"/>
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="2880" />
    </authentication>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
        <add namespace="Syncfusion.Mvc.Shared"/>
        <add namespace="Syncfusion.ReportViewer.Mvc"/>
      </namespaces>
    </pages>
    <httpHandlers>
      <add verb="GET,HEAD" path="MvcResourceHandler.axd" 
type="Syncfusion.Mvc.Shared.MvcResourceHandler, Syncfusion.Shared.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" 
validate="false"/>
      <add verb="*" path="syncfusion_generatereports.axd" validate="false" 
type="Syncfusion.ReportViewer.Mvc.ReportViewerHandler, Syncfusion.ReportViewer.Mvc, Version=11.144.0.21, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"/>
    </httpHandlers>

 

 

5.      Ajax and jquery script in page.

6.      Syncfusion ScriptManager in Page.

 

Razor:

 

<!DOCTYPE html>

<html>

<head runat="server">

    <meta name="viewport" content="width=device-width" />

    <title>ViewReport</title>

    <script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/MicrosoftAjax.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")" type="text/javascript"></script>

</head>

<body>

    <div style="width:100%;height:400px;">    

        @{Html.Syncfusion().ReportViewer("report", (ReportViewerModel)ViewData["ReportModel"]).Render();}

    </div>

    @{Html.Syncfusion().ScriptManager().Combine(true).Minify(true).Render();}

</body>

</html>

 

ASPX:

 

<html>
<head runat="server">
    <meta name="viewport" content="width=device-width" />
    <title>ViewReport</title>   
 
   <script src="<%=Url.Content("~/Scripts/jquery-1.6.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" type="text/javascript"></script> 
</head>
<body>
    <div style="width:100%;height:400px;">    
        <%= Html.Syncfusion().ReportViewer("report", (ReportViewerModel)ViewData["ReportModel"]))%>
    </div>
<%= Html.Syncfusion().ScriptManager() %>
</body>
</html>

 

7.      Controller information is fine what you have attached.

 

We have attached the sample in following forum thread.

http://www.syncfusion.com/support/forums/reportviewer-mvc/106896/SSRS-Support?

 

Please let me know if you have any queries.

 

Regards,

Lingaraj S.

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;