Assigning a resource key to a data value
Localizing text data that originates from a data source requires that you know the data values at report design time because you map each data value to a resource key when you design the report. If you do not map a data value to a resource key, the report displays the original data value. Assuming the original values are in English, if you do not map every value in the data set field, the report displays unmapped values in English and mapped values in the language specified by the user’s machine locale.
How to assign a resource key to a data value
1 In the layout editor, select the data element that displays the values to localize.
2 In Property Editor, choose the Map tab.
3 In Map List, choose Add to create a map rule.
4 In New Map Rule, specify the following information:
1 In the first field, select from the drop-down list, Value of this data item. The field displays the expression that refers to the data set field, which contains the values to localize.
2 In the second field, select an operator from the list. For example:
Equal to
3 In the third field, specify the value to localize, using one of the following steps:
*Choose <Select value...> from the drop-down list, as shown in Figure 30‑11. In Select Value, select a value.
Figure 30‑11 New Map Rule displaying the options for specifying the value to map
*Choose <Build expression...> to use the expression builder to write an expression.
*Type the value to replace. For example:
You must enclose string values in quotation marks (" ").
4 Skip the next field, “Then display following value”. Enter a value for this field only to map the data value to a literal text value.
5 Specify a resource key. Choose Browse to select a resource key. You can access resource keys only if you have assigned a resource file to the report.
Select Key displays the current list of keys and values that are defined in the resource file that the report uses.
1 Perform one of the following steps:
*Select an existing key to assign to the data value.
*Under Quick Add, create a new key and value, choose Add, then select the key from the list.
2 Choose OK to confirm the resource key selection. The resource key appears in the Resource Key field in New Map Rule. Figure 30‑12 shows a completed map rule, which maps the value Cancelled to the localized value defined for the resource key cancelled.
Figure 30‑12 Map rule that maps a data value to a resource key
6 Choose OK to save the map rule. The rule appears in Map List.
5 Repeat steps 3 through 4 to create additional rules, one for each data value to replace. Figure 30‑13 shows an example of six map rules created for a data element that displays order status.
Figure 30‑13 Six map rules for a data element