Set culture with expression containing variable

Stimulsoft Reports.NET discussion
Post Reply
japie
Posts: 2
Joined: Wed Sep 20, 2023 11:49 am

Set culture with expression containing variable

Post 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
Attachments
snapshot (21).xml
(13.96 KiB) Downloaded 46 times
ReportTest.mrt
(39.91 KiB) Downloaded 47 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set culture with expression containing variable

Post by Lech Kulikowski »

Hello,

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

Thank you.
#12517
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set culture with expression containing variable

Post 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.
japie
Posts: 2
Joined: Wed Sep 20, 2023 11:49 am

Re: Set culture with expression containing variable

Post 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.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Set culture with expression containing variable

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply