Silverlight Report Localization

5 posts, 0 answers
  1. Juergen
    Juergen avatar
    6 posts
    Member since:
    Mar 2013

    Posted 06 Oct 2014 Link to this post

    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
  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 09 Oct 2014 Link to this post

    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.

     
  3. Juergen
    Juergen avatar
    6 posts
    Member since:
    Mar 2013

    Posted 10 Oct 2014 Link to this post

    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.





  4. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 10 Oct 2014 Link to this post

    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.

     
  5. Juergen
    Juergen avatar
    6 posts
    Member since:
    Mar 2013

    Posted 13 Oct 2014 Link to this post

    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.
Back to Top