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

Report Designer - Textbox Culture Binding

2 Answers 466 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 13 Aug 2019, 01:23 PM

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 Answers, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 14 Aug 2019, 12:09 PM

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.

0
Silviya
Telerik team
answered on 16 Aug 2019, 06:59 AM

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
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Silviya
Telerik team
Share this question
or