How to: Format Decimal Values

When you create a client report definition (RDLC) layout for a report, a format variable is created for each decimal variable. The format information from the Column properties in Report Dataset Designer is stored in the format variable. Decimal values are formatted in the RDLC layout by using the format variable. If you create controls that use decimal values in an RDLC report layout, then you must manually specify in Visual Studio Report Designer to use the format variable for the formatting.

To format decimal values

  1. In the development environment, on the Tools menu, choose Object Designer.

  2. In Object Designer, choose Report, select a report that you want to modify, and then choose Design.

  3. On the View menu, choose Layout.

  4. In Visual Studio, in the report.rdlc file, right-click the text box that displays a decimal value, and then choose Text Box Properties.

  5. In the Text Box Properties window, choose the Number tab.

  6. In the Category list, choose Custom, and then choose the Function button (fx) next to the Custom format field.

  7. In the Expression window, select Fields (DataSet_Result), select the format variable from the list, and then choose OK. For example, if the Value field on the General tab is =Fields!Customer__Sales__LCY__.Value, then the expressions for the format on the Number tab should be =Fields!Customer__Sales__LCY__Format.Value.

See Also