Currency Formatted Textbox Renders Wrong in Certain Environments
Environment
Product | Progress® Telerik® Reporting |
Description
The rendered report document contains weird symbols in place of the currency symbol in the textboxes that have currency formatting applied.
When determining what Culture to use for formatting strings and text direction, the rendering engine will inspect those objects in the following order:
- The Culture of the TextBox.
- If the TextBox has no Culture defined, the Culture of the Report is used.
- If the Report has no Culture defined, the Culture of the CurrentThread is used.
Cause
This is caused by the environment, where the report is rendered, having a different culture than the machine, where the report was designed, or an invariant culture.
For example, if the production environment had a specific culture, which currency symbol was not available in the font used by the textbox.
Solution
Docker Containers
Some Docker Containers are created with invariant culture. This means that the locales like currency symbol ('$' in 'en-US') may appear unexpected. Use the following code in the Dockerfile to add your culture ('en-US' in the example) to the container:
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false\
# Set the locale
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8
In the above code, LC_ALL
stands for all locales, and LANG
stands for the language.
Other Environments
- You may wrap your textbox's Value expression in the FormatWithCulture(cultureName, format, args) text function to ensure that the textbox will be formatted with that specific culture.
- You may set the Report.Culture to a specific culture that will be used whenever the report is rendered.