Problem with localizing reports Q3 2010 SP1

12 posts, 1 answers
  1. Thomas Sonnenschein
    Thomas Sonnenschein avatar
    22 posts
    Member since:
    Dec 2008

    Posted 17 Jan 2011 Link to this post

    Hello,

      I have a massive problem on localizing my Reports with the actual Version (Q3 2010 SP1 / 2010.3.1221). I have some reports in german and english. In my report preview window I have a dropdown to switch the report language. This works fine in VS 2010. But when I deploy my application to a Win2003 Server, the problems start. No matter, what language I set in my dropdown, the report is always in german (which is the default language). For switching between the languages I use:
    Thread.CurrentThread.CurrentUICulture
    and
    Thread.CurrentThread.CurrentCulture

    The same application deployed to Windows Azure with Telerik Reports Version Q2 2010 (2010.2.921) works perfect. Have I to change something in my application to let it work again or is there a bug in the actual report release?

    In hope of help
     Thomas
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Jan 2011 Link to this post

    Hi Thomas,

    Are you by any chance using the Silverlight report viewer - if yes, this is a known problem that slipped into the Q3 release and would be addressed in the upcoming Q1 release (or earlier internal builds).
    If you're not using the Silverlight viewer, then we cannot reproduce the issue - I've attached a sample project that shows our observations with the latest official Q3 SP1 release.

    Greetings,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  3. DevCraft banner
  4. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 19 Jan 2011 Link to this post

    Hi

    We are using SL I we can reproduce the problem.

    Do you have a workaround?

    I need to set the cultureUI and Culture on the SL Client and send to the report server,
    I have tray passing as paramenter but the culture must be set before the InitializeComponent()
    The problem is that before the InitializateComponent() I don't have the parameters...

    Any idea how to fix this?

    Thank you

    public Report1()
            {
                /// <summary>
                /// Required for telerik Reporting designer support
                /// </summary>
    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(
    this.ReportParameters["lg"].Value.ToString())




                InitializeComponent();

                //
                // TODO: Add any constructor code after InitializeComponent call
                //
            }
  5. Thomas Sonnenschein
    Thomas Sonnenschein avatar
    22 posts
    Member since:
    Dec 2008

    Posted 20 Jan 2011 Link to this post

    Hello,

      thanks for your response. I tried your solution and added a Webinstall Project to it. With that, installed on my server the report works fine in all selected languages. Back to my project, where I work exact like in your sample, I than found, that the ressource dlls where not copied to the server. So the reports always show the default texts.
    The problem don't ocure in the Telerik Report, but in the installer. After copiing the ressource dlls to the bin folder on the server, the localization work fine.

    Now I have only to research, why the ressources are not copied during installation, but that is not a Telerik problem.

    Thanks
      Thomas
  6. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 20 Jan 2011 Link to this post

    Hi guys,

    @Iosu: We're working on fix that would be part of an internal build that is to come in the next few days.

    @Thomas: We're glad it is working on your end as well.

    Regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  7. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 23 Jan 2011 Link to this post

    Hi..

    I have just download the last bits,,
    On the change log I can see..

    Report Service

    • Fixed: Cannot localize a Report using the Localizable property


    Do you have an example on how to set the culture and cultureUI from the SL viewer???

    Thanks
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 24 Jan 2011 Link to this post

    Hi Iosu,

    You set the Culture and CurrentUICulture in the Silverlight application e.g. button click. It would be automatically picked up by the report and respected.

    Kind regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  9. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 24 Jan 2011 Link to this post

    HI

    Yes, I have check it and it works... When I set the on the SL Client.
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ca");
    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-UK");

    my report UI is in "ca" and the format of dates etc is in English
    That's ok

    But my question was diferent.

    My solution can have the cultureUI in spanish, but I want to send a "Sales quote report" to a customer that is on UK.. so I want to send the report in english... JUST the report, so If I change the cultureUI on the SL cliente, the all interfase is change to English..and I don't want this..

    That's way I want to be able to send a parameter to the report server with the culture and language  (independed of the SL client Language)... Any trick how to to that???
    The best way would be if I can override the DeviceCreateInfo on the SL Cliente or... The SL ReportViewer have bouth parameters, Culture and language

    Thanks

    Hi I have found another problem..if I set on a report a format to a date field like "{0:d}" and I change the culture the Date format is not changed, so for example.. In Spain the date should be "24/01/2010" but it shows "01/24/2010"  if I remove the format the the change of the culture is corrent.
    I can not upload a zip file here so I have create a support Ticket 387265




  10. Iosu Buenetxea
    Iosu Buenetxea avatar
    91 posts
    Member since:
    Jan 2008

    Posted 25 Jan 2011 Link to this post

    Let's keep here..

    On my example there is a Web and SL Project. Set the Startup project to web and you will see that there is no way to set the culture of the report because the SL Viewer does not have the  culture property. So if you run the sl example the DATE field with a format is not correctly formated to the SL client culture.

    The big issue for us is as I told you yesterday:

    My solution can have the cultureUI in spanish, but I want to send a "Sales quote report" to a customer that is on UK.. so I want to send the report in english... JUST the report, so If I change the cultureUI on the SL cliente, the all interfase is change to English on the SL app..and I don't want this..

    That's way I want to be able to send a parameter to the report server with the culture and language  (independed of the SL client Language)... Any trick how to to that???
    The best way would be if I can override the DeviceCreateInfo on the SL Cliente or... The SL ReportViewer have bouth parameters, Culture and language

    and also for sure that we want to be able to give a format to DATE a Numbers. But the format must be able to change to the one set on the SL Viewer.

    Thank you

  11. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 28 Jan 2011 Link to this post

    Hi Iosu,

    After further look into your project, we noticed that the culture does not fall back automatically to the current thread, because you have at some point set culture for this report through the Culture property. Then while playing around you probably decided to remove the culture, but instead of resetting the Culture property you've set it to (Default) from the DropDownList, which for some obscure reason serializes the following in the InitializeComponent method:

    this.Culture = new System.Globalization.CultureInfo("");

    After resetting the Culture property, this line is gone and the formatting works correctly without any further modifications in any of the supported platforms.

    As for your inquiry, we do not notice such an observation, on our end. Changing only the CurrentUICulture only changes the UI and not other attributes which are in the domain of the CurrentCulture. You can see a short video with your project along with the revised project.

    Kind regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
  12. radhika
    radhika avatar
    7 posts
    Member since:
    Dec 2015

    Posted 21 Jan Link to this post

    Hello, 
    public Form1()
            {
                System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");  //get input string from report parameters
                System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); //get input string from report parameters
                InitializeComponent();
            }

    this approach works properly, but only if we write set CutureCode before InitializeComponent(); Not after it. Is there Any alternative possible for that?

    Also How do I get Report Parameters directly in construtor for achieving this kind of approach ->
    "System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");  //get input string from report parameters i.e parameters["CultureInfoCode"].value"

  13. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 21 Jan Link to this post

    Hi Radhika,

    Please check my last post in the Report Localization / Globalization Problem forum thread.

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner