Page 1 of 1

Display messages/exceptions in StiMvcMobileDesigner

Posted: Wed Jul 13, 2016 1:09 pm
by sbd_jeff
Hi Stimulsoft,
I've been tasked with migrating our Stimulsoft implementation to the latest 2016 version.
They are specifically interested in the HTML5 designer.

Previously we were using StiMvcDesigner which is based on Flash. Using that control I was able to display success and error messages using the following approach:

Code: Select all

public ActionResult SaveReportTemplate()
        {
            try
            {                
                // Get report from designer
                StiReport report = StiMvcDesigner.GetReportObject(this.Request);                
                //... Save the file...
                return StiMvcDesigner.SaveReportResult("Report Saved!");
            }
            catch (Exception ex)
            {                
               return StiMvcDesigner.SaveReportResult(string.Format("Could not save report! Exception: {0}", ex.Message));
            }
However, with StiMvcMobileDesigner I only have this method to return:

Code: Select all

return StiMvcMobileDesigner.SaveReportTemplateResult(this.HttpContext);
Is there a way to provide feedback to an end user regarding success/failure messages using the StiMvcMobileDesigner control?

Thanks!

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Fri Jul 15, 2016 7:11 am
by Alex K.
Hello,

Please try to use the following code:

Code: Select all

return new StiActionResult("{\"error\":\"" + string.Format("Could not save report! Exception: {0}", ex.Message) + "\"}", false);
instead

Code: Select all

return StiMvcDesigner.SaveReportResult(string.Format("Could not save report! Exception: {0}", ex.Message));
Thank you.

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Fri Jul 15, 2016 1:53 pm
by sbd_jeff
Hi Aleksey,
Thank you for the response.
I tried that approach, but it does not appear to work.
I get this response (attached):
Message from webpage:
Error Parsing!

We're using 2016.1.0.0
  • Stimulsoft.Base
    Stimulsoft.Report
    Stimulsoft.Report.Mvc
    Stimulsoft.Report.MvcMobile
This is the line I tried:

Code: Select all

return new Stimulsoft.Report.MvcMobile.StiActionResult("{\"error\":\"" + string.Format("Could not save report! Exception: {0}", ex.Message) + "\"}", false);

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Fri Jul 15, 2016 2:29 pm
by Alex K.
Hello,

Most probably, some problems in parsing your error message.
Please try to use the following code:

Code: Select all

return new Stimulsoft.Report.MvcMobile.StiActionResult("{\"error\":\"" + string.Format("Could not save report! Exception: {0}", "Test Text") + "\"}", false);
and let us know about the result.

Thank you.

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Fri Jul 15, 2016 3:00 pm
by sbd_jeff
Hi Aleksey,
That works!

I can work with that.

One more question. Is there a way to do a notification to the user in the case of success?
Something like:

Code: Select all

return new Stimulsoft.Report.MvcMobile.StiActionResult("{\"message\":\"Report Saved\"}", false);
Thanks!

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Mon Jul 18, 2016 2:27 pm
by HighAley
Hello.

Sorry for the delay with answer.
We need more time to prepare an answer.

Thank you.

Re: Display messages/exceptions in StiMvcMobileDesigner

Posted: Tue Aug 09, 2016 8:56 am
by HighAley
Hello.

We have made an improvement.
Please, check our next prerelease build.
The code above will work there.

Thank you.