Using CDbl function with different regions

3 posts, 0 answers
  1. Rajika
    Rajika avatar
    4 posts
    Member since:
    Mar 2018

    Posted 16 Nov 2018 Link to this post


    We have identified that CDbl function work as intended only when the data (number) is according to the format of the machine region.

    eg: If a number is 33165,25 according Norwegian region, CDbl will work only if the machine region is set to Norway, otherwise it will throw an error.

    Is there any workaround for a scenario where we need to use data formatted according to a different region setting compared to the machine region.

  2. Silviya
    Silviya avatar
    418 posts

    Posted 21 Nov 2018 Link to this post

    Hello Rajika,

    In general, reports are processed and rendered with the current thread's culture e.g. In VS it is English by default (VS settings), and with the Standalone Report Designer tool it will be the machine's culture settings.
    I'm not sure where it is failing with an error. Is it in when previewing the report from the designer or in an application?

    In report designer, a report is globalized with the help of a System.Globalization.CultureInfo object. You can specify a Culture for the entire Telerik.Reporting.Report by setting its Report.Culture property. This will force all Telerik.Reporting.TextBox items to respect the assigned Culture. For more information, please check the Report Globalization help article.

    When you run the report from an application, you can set the current thread's culture which will cause the reporting engine to use these culture settings for conversion like decimal and group delimiters. Setting the culture in a web application can be done on request e.g.  Localization in ASP.NET MVC 4.

    Progress 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
  3. Rajika
    Rajika avatar
    4 posts
    Member since:
    Mar 2018

    Posted 21 Nov 2018 in reply to Silviya Link to this post

    Hi Silviya,

    We solved the problem by setting the culture of the current thread at the start of the application as you have mentioned.

    Thank you.
Back to Top