Search code examples
c#asp.net-mvcstimulsoft

Error with StimulSoft v2015.2 (StiMvcMobile)


I use stimulsoft 2015 v.2 in my mvc app i use stimvcmobile for design report and when i run my app with below code i recieve some error:

 <head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    @Html.Stimulsoft().RenderMvcMobileDesignerScripts()
</head>
<body>
    <div>
        @Html.Stimulsoft().StiMvcMobileDesigner(new StiMvcMobileDesignerOptions()
        {
            ActionGetReportTemplate = "GetReportTemplate",
            ActionGetReportSnapshot = "GetReportSnapshot"

         })
    </div>
</body>

error: CS1502: The best overloaded method match for 'Stimulsoft.Report.MvcMobile.StiMvcHelper.StiMvcMobileDesigner(string)' has some invalid arguments

My Resharper suggest Add .ToString() to end of Helper and above error remove but report designer not work why??Please Help?? My Code:

 @Html.Stimulsoft().StiMvcMobileDesigner(new StiMvcMobileDesignerOptions()
        {
            ActionGetReportTemplate = "GetReportTemplate",
            ActionGetReportSnapshot = "GetReportSnapshot"

        }.ToString())

And error in browser Console is:Uncaught SyntaxError: Unexpected token .


Solution

  • Add a name of the component as the first parameter.

    ... StiMvcMobileDesigner("StiMvcMobileViewer1", new StiMvcMobileDesignerOptions()