Page 1 of 1
Globalized Enum
Posted: Thu Jun 14, 2012 8:52 am
by TeWe
Hello,
I have a problem, which I can not solve. I still use globalized labels in the reportdesigner via setting the "Globalized Name" property and putting the text into a resx-file. But I'm not able to globalize enum-values. I would like to put an enums-value into the report by using his int-value and in the report I would like to see a depending text. The text should be localiced.
E.g. SomeEnum with values from 0 to 2 should show the globalized text "test 1", "test 2", "test3".
How can I solve this? Can I set globalized labels used in an expression or something like that?
Thanks in advance!
Regards,
Thorsten
Globalized Enum
Posted: Fri Jun 15, 2012 5:38 am
by Alex K.
Hello,
Can you please describe your task in details? And, if possible, send us a sample.
Thank you.
Globalized Enum
Posted: Fri Jun 15, 2012 9:14 am
by TeWe
Hello Aleksey,
I try to describe with more details. I know how to globalize an textlabel in the report-layout via designer. I set the "Globalized Name" property with an id and put the text into a resx-file. Before I show the report, the resx-file will be defined in the GlobalizationManager class. This works perfectly.
But I only get this work with textlabels where I can set the "Globalized Name" property via Gui. I don't know how handle different type of text. E.g. in expressions. I often have to handle enum values. E.g. the reports receive int values which I want to translate into humanreadable text. "0" shall be displayed as "Test Example 1", "1" for "Another Test Example 2".
The expression which do this can look like this:
{switch (DataSource.FieldName == 0, "Test Example 1", DataSource.FieldName == 1, "Another Test Example 2")}
But how to use the globalization feature in this expression of an layout? How can I put the text into resx-files to make it translateable?
I hope I could make my point clear.
Regards
Globalized Enum
Posted: Mon Jun 18, 2012 10:17 am
by Ivan
Hello,
You can add yours text strings to the resx-file, and then use the following expression:
Code: Select all
{this.GlobalizationManager.GetString("name_of_your_text")}
For example, you can add strings "test1", "test2" and then write
Code: Select all
{switch (DataSource.FieldName == 0, this.GlobalizationManager.GetString("test1"), DataSource.FieldName == 1, this.GlobalizationManager.GetString("test2"))}
Thank you.
Globalized Enum
Posted: Mon Jun 18, 2012 12:21 pm
by TeWe
That was exactly what I needed.
Thanks a lot!
Regards
Globalized Enum
Posted: Tue Jun 19, 2012 2:53 am
by Andrew
Hello,
Great!
Let us know if have additional questions.
Thank you.