Report Designer - Textbox Culture Binding

3 posts, 0 answers
  1. Matt
    Matt avatar
    2 posts
    Member since:
    Mar 2019

    Posted 13 Aug Link to this post

    Hello,

    I have a report that needs to dynamically change its currency symbol based on the customer.

    Localization is set to true, and I have tried setting the data binding both on the entire report and specific text boxes that are formatted with {0:C2}.

    When changing the culture manually to both the report and text box it works but applies those cultures to ALL reports.

    The query field that shows the currency type returns as one of the following:

    USD , EUR, GBP, CAD, CNY

    This is the expression I am trying to use to dynamically change the culture of the text box based on the currency type returned.

    IIF(Fields.InvoiceCurrencyCode IS NULL, (Default), IIF(Fields.InvoiceCurrencyCode = USD, (Default),IIF(Fields.InvoiceCurrencyCode = CAD,(Default),IIF(Fields.InvoiceCurrencyCode = GBP, en-GB,IIF(Fields.InvoiceCurrencyCode = EUR, nl-NL,IIF(Fields.InvoiceCurrencyCode = CNY,zh-CN,(Default)))))))

    I have tried adding double quotations surrounding comparer and true values and it does not change anything.

    In the Binding the property is set to Culture.

    What am I missing to make this work?

    Please and thank you.

  2. Matt
    Matt avatar
    2 posts
    Member since:
    Mar 2019

    Posted 14 Aug Link to this post

    For anyone looking for the answer to this.

    Set your report culture to anything BUT (Default)
    then when you try binding, you can set individual text boxes to any other variation of culture needed.

    Report Culture: en-CA
    Text box Data Binding : Culture  =>  Expression : =IIF(Fields.InvoiceCurrencyCode = "EUR","nl-NL",IIF(Fields.InvoiceCurrencyCode = "USD" , "en-CA", IIF(Fields.InvoiceCurrencyCode = "CNY", "zh-CN",IIF(Fields.InvoiceCurrencyCode = "GBP", "en-GB","en-CA"))))

    or name it what ever you bring back from the query.

  3. Silviya
    Admin
    Silviya avatar
    391 posts

    Posted 16 Aug Link to this post

    Hi Matt,

    I assume that you already figured out the problem. Thank you for providing the answer for our community.

    Best Regards, Silviya
    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
Back to Top