Page 1 of 1

Set culture with expression containing variable

Posted: Wed Sep 20, 2023 12:15 pm
by japie
I'm trying to change the culture with an expression. The expression only contains a variable: {V_Taal}. According to the documentation, it should be possible to set the culture with an expression. The variable's expression is:

Switch(main.Taal == "585be0fd-cf31-4b88-a003-cb7114b0bf84", "en-GB", main.Taal == "54d9b25e-eaf0-4af6-8fa3-5ce181588e61", "nl-NL")

When I print the variable to the report, it shows the correct value. However, the report doesn't translate the text. Attached is a sample report.
Can it be achieved? Any help would be appreciated :D

Version I'm using is Stimulsoft Designer 2023.3.4

Re: Set culture with expression containing variable

Posted: Thu Sep 21, 2023 7:15 am
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
#12517

Re: Set culture with expression containing variable

Posted: Mon Sep 25, 2023 7:41 pm
by Lech Kulikowski
Hello,

> According to the documentation, it should be possible to set the culture with an expression.

Could you clarify where do you find it?

> When I print the variable to the report, it shows the correct value. However, the report doesn't translate the text. Attached is a sample report.

This expression is calculated BEFORE the report rendering starts, when data is not yet connected. If there is no data, the result of the expression is empty, so globalization does not work.
In that case, you should set that variable values in the code.

Thank you.

Re: Set culture with expression containing variable

Posted: Wed Sep 27, 2023 6:49 am
by japie
Hi Lech,

Thank you for your reply. In the the second screenshot in his article the report culture is based on a datasource: https://www.stimulsoft.com/en/blog/arti ... xpressions
So I gathered it would be possible to use a datasource column in the culture's expression.

Re: Set culture with expression containing variable

Posted: Wed Sep 27, 2023 9:48 pm
by Lech Kulikowski
Hello,

Thank you for the information. We will correct the article.

Thank you.