Globalisation to display report in one of several languages

Stimulsoft Reports.NET discussion
Post Reply
mihiri2
Posts: 43
Joined: Mon Apr 08, 2013 2:29 am

Globalisation to display report in one of several languages

Post by mihiri2 »

Hi,

I have three cultures (Arabic [ar], Chinese (Simlified)[zh-CHS], Catalan[ca]) added on Globalization editor.

My OS primary culture is en-US.

What I try to do is in Report Begin Rendering event to do following

string cultureName = "ar";
this.LocalizeReport(new CultureInfo(cultureName));

I was expecting, this would force the report to display in Arabic. Unfortunately it still seems to be picking up the culture from OS.

Is it possible to do what I am trying to do above?

Thanks

Regards

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

Re: Globalisation to display report in one of several langua

Post by HighAley »

Hello, Mihiri.

If you use the Globalization Editor, than it's possible to localize the report before compilation only.
Please, set localization before compilation of the report or you could use the Globalization Manager.

Thank you.
mihiri2
Posts: 43
Joined: Mon Apr 08, 2013 2:29 am

Re: Globalisation to display report in one of several langua

Post by mihiri2 »

Hi HighAley,

Thanks for the reply.
1."set localization before compilation of the report-"

How do I do this. I already tried in Report Begin Rendering event to do following
string cultureName = "ar";
this.LocalizeReport(new CultureInfo(cultureName));

Which doesn't work and report still displays OS primary culture which is en-US.


2. Using GlobalizationManager:

can you please explain in detail what is "GlobalizedReport.MyResources"? Is it a namespace?

report.GlobalizationManager = new GlobalizationManager("GlobalizedReport.MyResources", new CultureInfo(cultureName));
Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Globalisation to display report in one of several langua

Post by HighAley »

Hello, Mihiri.

1. It's impossible to do this in the Begin Rendering event because at this moment the report is already compiled.

2. The GlobalizedReport.MyResources is the resource file.
You could find a sample project on the GitHub.

Thank you.
Post Reply