GlobalizationManager not working in MvcMobileDesigner?

Stimulsoft Reports.WEB discussion
Post Reply
rodrigo.avots
Posts: 21
Joined: Tue Nov 22, 2016 2:15 pm

GlobalizationManager not working in MvcMobileDesigner?

Post by rodrigo.avots »

I add GlobalizationManager in GetReportTemplate and GetReportSnapshotD but not works!

//GetReportSnapshotD
public ActionResult GetReportTemplate(string id)
{
StiReport report = new StiReport();
try
{
report.Load(Server.MapPath("~/Content/Reports/" + id + ".mrt"));
GetResults(report);
//Globalization -- not work
report.GlobalizationManager = new GlobalizationManager(GetCulture());

StiMvcMobileDesignerOptions opt = new StiMvcMobileDesignerOptions();
opt.Theme = Stimulsoft.Report.MvcMobile.StiTheme.Office2013DarkGrayBlue;
//opt.Localization = GetLocalizationDesigner();

return StiMvcMobileDesigner.GetReportTemplateResult(HttpContext, report);
}
catch (Exception e)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Custom Error Message: " + e.Message);
}

}

public ActionResult GetReportSnapshotD(string id)
{
StiReport report = StiMvcMobileDesigner.GetReportObject(HttpContext);

//Globalization -- not work
report.GlobalizationManager = new GlobalizationManager(GetCulture());


return StiMvcMobileDesigner.GetReportSnapshotResult(HttpContext, report);
}


Another question, could you give me an example of how to apply StiMvcMobileDesignerOptions[in blue].

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

Re: GlobalizationManager not working in MvcMobileDesigner?

Post by HighAley »

Hello.

Please, check next sample of the Globalization.
Does it work on your side?

You should set the StiMvcMobileDesignerOptions on the View. Please, look at the sample here:

Thank you.
rodrigo.avots
Posts: 21
Joined: Tue Nov 22, 2016 2:15 pm

Re: GlobalizationManager not working in MvcMobileDesigner?

Post by rodrigo.avots »

I did as the example. Did not work
In viewer work fine, but designer not work!

// --- MvcMobileViewer Actions --- ok fine //
public ActionResult GetReportSnapshot(string id)

{
StiReport report = new StiReport();

//Globalization
report.GlobalizationManager = new GlobalizationManager(GetCulture());


report.Load(Server.MapPath("~/Content/Reports/" + id + ".mrt"));
GetResults(report);

return StiMvcViewer.GetReportSnapshotResult(report);
}
public CultureInfo GetCulture()
{
CultureInfo cultureName = new CultureInfo(Thread.CurrentThread.CurrentCulture.ToString());
return cultureName;
}

But...

// --- MvcMobileViewer Actions --- problem //
public ActionResult GetReportSnapshotD(string id)
{
StiReport report = StiMvcMobileDesigner.GetReportObject(HttpContext);

//Globalization -- not work
report.GlobalizationManager = new GlobalizationManager(GetCulture());


return StiMvcMobileDesigner.GetReportSnapshotResult(HttpContext, report);
}

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

Re: GlobalizationManager not working in MvcMobileDesigner?

Post by HighAley »

Hello.

We have fond a bug in our code that caused the GlobalizationManager does not work.
We have made an improvement. Please, check our next build when it will be available.

Thank you.
Post Reply