Articles in this section

Dynamically Format Currency Values Based on Language in Bold Reports

Published:
Updated:

Overview

In Bold Reports, currency values can be formatted dynamically based on the selected culture by using expressions and report parameters. This approach enables reports to display appropriate currency symbols and formats, such as the dollar ($) symbol for en-US and the euro (€) symbol for fr-FR. This improves localization and usability in multilingual reporting environments.

Step-by-Step Instructions

Step 1: Create a Language Parameter

  • In the Data configuration pane of the Bold Reports Web Designer, click the Parameters icon and select New Parameter.
  • Set the Name to Language and the Prompt property to Select Language.
  • In the Available Values section, select Specify values.
  • Click Add and enter the culture values that the report should support.
  • Click OK to save the parameter.
    image.png

Step 2: Apply the Dynamic Format Expression

  • Select the Textbox or Table Cell that contains the numeric value to be formatted as currency.

  • Open the Properties pane.

  • Locate the Format property.

  • Click the expression (fx) icon next to it and select Expression.

  • In the Expression Editor, enter the Switch expression shown below.

    image.png

Use the following expression to dynamically format currency values based on the selected Language parameter:

=Switch(
   Parameters!Language.Value = "en-US", "$#,##0.00;($#,##0.00)",
  Parameters!Language.Value = "fr-FR", "€#,##0.00;(€#,##0.00)",
  True, "#,##0.00;(#,##0.00)"
)

Step 3: Save and Preview the Report

  • Click Preview in the top toolbar.
  • Select English (US) from the Language parameter dropdown and click View Report. The values are displayed with the $ currency symbol.
    image.png
  • Change the parameter to French (France) and click View Report. The values are displayed with the currency symbol.
    image.png

Sample Report

Download the sample report from here

See Also

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied