Page 1 of 1
How to select culture setting based on a variable
Posted: Thu Dec 15, 2022 9:31 am
by jlorue
Hi,
Using the Globalization editor, I have defined 2 languages for a Dashboard: English and Spanish.
When showing the Dashboard, I need to select the languaje based on the value of a variable.
How can I do that?
Thanks
Re: How to select culture setting based on a variable
Posted: Thu Dec 15, 2022 12:35 pm
by Max Shamanov
Hello,
We need some additional time to investigate the issue, we will let you know about the result.
Thank you.
Re: How to select culture setting based on a variable
Posted: Thu Dec 15, 2022 7:20 pm
by Max Shamanov
Hello,
Please check the new "Report culture expressions" feature that was added in the new 2023.1.1 release:
https://www.stimulsoft.com/en/blog/news ... dashboards
Thank you.
Re: How to select culture setting based on a variable
Posted: Thu Dec 15, 2022 7:47 pm
by jlorue
Hi Max,
Yes, I had already seen it.
The point is that I could not find where or how to set the expression to select the language (based on the value of a variable) in the Globalization section
Could you please guide me?
Thanks
Re: How to select culture setting based on a variable
Posted: Fri Dec 16, 2022 7:03 am
by Max Shamanov
Hello,
In the Culture property, select Insert Expression.
Please check the attached image.
Thank you.
Re: How to select culture setting based on a variable
Posted: Fri Dec 16, 2022 6:09 pm
by jlorue
Thanks Max. But I still cannot figure out how to build the expression.
Ej:
if {var1} == 1 then it should select English
if {var1} == 2 then it should select Spanish
if {var3} == 3 then it should select Italian
How should I build the expression?
Thanks
Re: How to select culture setting based on a variable
Posted: Sun Dec 18, 2022 11:38 pm
by Lech Kulikowski
Hello,
You can use the following expression:
{Switch(var1 == 1, "En-us", var1 == 2, "Es-es", var1 == 3, "IT-it")}
Thank you.
Re: How to select culture setting based on a variable
Posted: Fri Dec 23, 2022 7:45 pm
by jlorue
It work! thanks a lot Lech and merry Christmas!!
Re: How to select culture setting based on a variable
Posted: Fri Dec 23, 2022 9:56 pm
by Lech Kulikowski
Hello,
Merry Christmas and a Happy New Year. May your coming year be filled with magic and dreams!