Category / Section
How to Format Decimal Values in Bold Reports
Published:
Updated:
Bold Reports is a powerful reporting tool that allows users to create and customize reports for a variety of purposes. One common use case involves formatting decimal values in reports. For instance, users may want to show decimal values as whole numbers without extra zeros. This article provides a step-by-step guide on how to achieve this formatting requirement in Bold Reports using expressions within your report dataset fields.
- Identify the target cell
Identify and select the tablix cell to which you want to apply the formatting. This cell should be bound to the dataset field containing the decimal values.
- Define the Expression
Click on the expressions menu to open the expression builder. In the expression editor, enter the following expression to define the field value.
=IIF(Fields!YourDecimalField.Value = Floor(Fields!YourDecimalField.Value), Format(Fields!YourDecimalField.Value, "0"), Format(Fields!YourDecimalField.Value, "0.00"))
Note:
- This conditional function evaluates whether the decimal field is a whole number or not. If the field is a whole number, it formats it without any decimal places; otherwise, it formats it with two decimal places.
- Replace YourDecimalField with the name of your dataset field containing the decimal values.
- Save and Preview the Report
After applying the expression and formatting, preview the report to ensure that decimal values are formatted as expected.
By utilizing expressions, formatting decimal values in Bold Reports is a simple process. These formatting options can enhance the visual presentation and efficiency of reports, ensuring that numeric data is displayed clearly and effectively.
For your reference, you can download the sample report here.