topic hubReporting & Analyticsofficial - Microsoftreviewed - checked by Opus

Formatting report data

Formatting report data in AL covers how to control the display of field values in report datasets: decimal precision, dates, booleans, enums, currencies, and regional formats. It answers questions about AutoFormatType, AutoFormatExpr, DecimalPlaces, the Format method, and report Language and FormatRegion settings.

Path: Development > Programming in the AL language > Developing reports > Formatting report data · tier official · system reporting · narrative reviewed (checked by Opus)

Overview

This section explains how numbers, dates, and other values appear in Business Central reports. It has three pages. Two cover formatting of the values themselves, and one covers localization.\n\n"Formatting the data in a field" describes the field properties AutoFormatType, AutoFormatExpression, and DecimalPlaces. These control how decimal values in tables, pages, and reports show as amounts, unit amounts, or currencies, with thousand separators or custom formats. "Formatting field values in report datasets" applies these properties to report datasets. It also describes the Format method, which controls how dates, booleans, and enums display, and the Language and FormatRegion methods, which handle regional formats.\n\n"Localizing the report data formatting and caption strings" explains how to set the report Language and FormatRegion properties in code, on settings pages, or at runtime. It covers date, time, and decimal formatting, including RDLC formatting. Start with the field formatting page for the basics, then move to the dataset page, then to localization.

Key points

  • AutoFormatType, AutoFormatExpr/AutoFormatExpression, and DecimalPlaces control how decimal values display, including amounts, unit amounts, and currencies.
  • Field formatting applies to tables, pages, and reports, and can include thousand separators and custom formats.
  • In report datasets, the Format method controls display of dates, booleans, and enums.
  • The Language and FormatRegion methods set language and regional formats for dataset values.
  • The report Language and FormatRegion properties can be set in code, on settings pages, or at runtime.
  • Localization affects date, time, and decimal formatting, and also applies to RDLC layouts.

Learn pages

Business Central pages and reports

The pages, reports and queries this hub’s Learn pages name (ms.search.form, API reference), joined to the code by exact object id (data/index/docs-objects.json); a page shows the table it runs on.

Source: Microsoft Learn (CC BY 4.0). Descriptions are Learn’s own.

What Learn documents here 3 Learn pages