Display messages/exceptions in StiMvcMobileDesigner

Stimulsoft Reports.WEB discussion
Post Reply
sbd_jeff
Posts: 27
Joined: Fri Nov 08, 2013 9:39 pm

Display messages/exceptions in StiMvcMobileDesigner

Post 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!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Display messages/exceptions in StiMvcMobileDesigner

Post 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.
sbd_jeff
Posts: 27
Joined: Fri Nov 08, 2013 9:39 pm

Re: Display messages/exceptions in StiMvcMobileDesigner

Post 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);
Attachments
Error
Error
stiresulterror.png (12 KiB) Viewed 3895 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Display messages/exceptions in StiMvcMobileDesigner

Post 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.
sbd_jeff
Posts: 27
Joined: Fri Nov 08, 2013 9:39 pm

Re: Display messages/exceptions in StiMvcMobileDesigner

Post 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!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Display messages/exceptions in StiMvcMobileDesigner

Post by HighAley »

Hello.

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

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Display messages/exceptions in StiMvcMobileDesigner

Post by HighAley »

Hello.

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

Thank you.
Post Reply