This is a migrated thread and some comments may be shown as answers.

Silverlight Report Localization

4 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Juergen
Top achievements
Rank 1
Juergen asked on 06 Oct 2014, 03:54 PM
Hi,

we have a problem with the localization of reports.
It works fine when we use the Silverlight ReportViewer. Then we can set the current culture and the report is displayed in that language.
(System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo)

Now we want to use the report engine directly to generate an pdf document.
So we use:
var serviceClient = new ReportServiceClient(new Uri(App.Current.Host.Source, "../Reports/ReportService.svc"));
               serviceClient.RenderAsync("PDF",
                   PROP_ReportViewer_MCred,
                   deviceInfo,
                   parameters);
               serviceClient.RenderCompleted += new EventHandler<RenderEventArgs>(serviceClient_RenderCompleted);
with that the current culture settings are ignored and the report is always in the default language.
What is the way to go here?
Btw. we are using Report Q2 2012 because of SL4.

Kind regards

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Oct 2014, 12:33 PM
Hello Juergen,

Reports are entirely processed and rendered on the server, where the Reporting WCF service operates. Thus you need to set the culture of the service's start application in order to get the localized resources for the report. Additionally, the report can be localized as in the Localizing Reports article .


I hope the above information is helpful.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Juergen
Top achievements
Rank 1
answered on 10 Oct 2014, 07:04 AM
Hello Sef,

the problem is that the language of the report is set by the user. He decides wether to see it in english, german or french.
The localization itself is not the problem, that  works fine with the viewer. For that we set the culture of the current thread prior to rendering.The setting of the thread culture doesn´t work for the use of the ReportServiceClient and RenderAsync. We tried setting the culture to the desired language, but the generated Report is always in the default language.

How would we set the culture of the service´s start application as needed?

The only idea I get at the moment is to copy the report and generate one Report for every language. Which will probably work, but then we have to maintain the same report 3 times.





0
Stef
Telerik team
answered on 10 Oct 2014, 04:31 PM
Hi Juergen,

If the service is in a web application, test using the globalization element or add a Global.asax file and change the culture OnBeginRequest. This will assure the current culture for the process is changed before the report processing begins.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Juergen
Top achievements
Rank 1
answered on 13 Oct 2014, 08:14 AM
Thanks, I will give that a try.

In the meantime I copied the report for the 3 languages and it works that way.
Which is ok, but not very clean.
If your suggestion works that would be better.
Tags
General Discussions
Asked by
Juergen
Top achievements
Rank 1
Answers by
Stef
Telerik team
Juergen
Top achievements
Rank 1
Share this question
or