- JavaScript runtime error: 'StiMvcViewer' is undefined

Stimulsoft Reports.WEB discussion
Post Reply
beginner
Posts: 36
Joined: Thu Jun 18, 2015 5:01 am

- JavaScript runtime error: 'StiMvcViewer' is undefined

Post by beginner »

I'm trying to render Stimulsoft viewer on my MVC 5 app, I'm using VS 2013 Update 2 and Stimulsoft 2014.3.v3.9.0.


This is my view Code:

Code: Select all

    @using Stimulsoft.Report.Mvc
    @using System.Web.UI.WebControls

    @Html.Stimulsoft().RenderMvcViewerScripts()

    @Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
    ActionGetReportSnapshot = string.Concat("LoadReport?Id=Report.mrt"),
    Width = Unit.Point(500),
    Theme = StiTheme.Default,
    ActionExportReport = "ExportReport",
    Height = Unit.Point(400),
    Controller = "GenericReport",
})

It never hits the action method, I'll get
{"Value cannot be null.\r\nParameter name: key"}
exception, unless I add this line to the web.config
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
.

This way I'll get
- JavaScript runtime error: 'StiMvcViewer' is undefined
error message. It doesn't reach to the action method. And I should note that the Flash version renders just fine.

Please help, I've asked about the first exception before, http://forum.stimulsoft.com/viewtopic.php?f=13&t=40170, but I didn't find any useful answer.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: - JavaScript runtime error: 'StiMvcViewer' is undefined

Post by HighAley »

Hello.

Please, check your web.config file. There should be next section:

Code: Select all

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="2.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
Thank you.
Post Reply