Error In StiMvcMobilrDesigner

Stimulsoft Reports.WEB discussion
Post Reply
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

Error In StiMvcMobilrDesigner

Post by Abbas »

Hi,
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:

Code: Select all

<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:

Code: Select all

  @Html.Stimulsoft().StiMvcMobileDesigner(new StiMvcMobileDesignerOptions()
        {
            ActionGetReportTemplate = "GetReportTemplate",
            ActionGetReportSnapshot = "GetReportSnapshot"
            
        }.ToString())
And error in browser Console is:Uncaught SyntaxError: Unexpected token .
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error In StiMvcMobilrDesigner

Post by HighAley »

Hello.

Sorry, but we couldn't reproduce the issue.
Could you send us a working VS project?

Thank you.
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

Re: Error In StiMvcMobilrDesigner

Post by Abbas »

Hi Aley..
My above Problem with this code solved:
i used your document code for stimvcMobile designer but its wrong and i used your code in example directory(two different code why??? :| :? )
but now I receive new Error in below code in mycontroller :

Code: Select all

 var sreport = new StiReport();

             sreport.Load(Server.MapPath("~/ReportTemplate/Periodic.mrt"));
            var json =/*Some Json String*/
            var ds = StiJsonToDataSetConverter.GetDataSet(json);
            sreport.Dictionary.Clear();
            sreport.RegData(ds);
            sreport.Dictionary.Synchronize();
                      
            return StiMvcMobileDesigner.GetReportTemplateResult(HttpContext,sreport);


I receive This Runtime Error:
Object reference not set to an instance of an object.

in last line code

Code: Select all

 return StiMvcMobileDesigner.GetReportTemplateResult(HttpContext,sreport);
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error In StiMvcMobilrDesigner

Post by HighAley »

Hello.
Abbas wrote:i used your document code for stimvcMobile designer but its wrong and i used your code in example directory(two different code why??? :| :? )
Please, send us links on both code samples. What is wrong in documentation?
Abbas wrote:but now I receive new Error in below code in mycontroller :
What version of ASP.NET MVC do you use? If you use MVC 4 or later you shoul duse assembly binding:

Code: Select all

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.1" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
Thank you.
Abbas
Posts: 27
Joined: Tue Oct 13, 2015 2:10 pm

Re: Error In StiMvcMobilrDesigner

Post by Abbas »

Hi my friend...
In StimulSoft document Wrote These Codes:

Code: Select all

@Html.Stimulsoft().StiMvcMobileDesigner(new StiMvcMobileDesignerOptions() {
ActionGetReportTemplate = "GetReportTemplate",
Width = Unit.Percentage(100),
Height = Unit.Pixel(700)
})
:| This Code is wrong----http://www.stimulsoft.com/en/documentat ... ng-manual/
And In Your Sample Code is:

Code: Select all

  @Html.Stimulsoft().StiMvcMobileDesigner(
    "MvcMobileDesigner1",
    new StiMvcMobileDesignerOptions
    {
     
        ActionGetReportTemplate = "GetReportTemplate",
        ActionGetReportSnapshot = "GetReportSnapshot",
        ActionOpenReportTemplate = "OpenReportTemplate",
        ActionSaveReportTemplate = "SaveReportTemplate",
        ActionGetNewReportData = "GetNewReportData",
        ActionDesignerEvent = "DesignerEvent"
        
    })
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error In StiMvcMobilrDesigner

Post by HighAley »

Hello.

Thank you for this information.
We will correct our documentation.

Thank you.
Post Reply