Define regional settings in reports

Completed

By default, the language of text and format of numbers, dates, and times in a report are based on your working language and region settings, which are defined on the My Settings page.

Screenshot of the my settings view.

The Region setting determines how dates, times, numbers, and currencies are shown or formatted. It also determines what character is used as the decimal separator when using a numeric keyboard to enter data.

You can, however, change the language and format region on a case-by-case basis when you preview, print, or send a report. On the request page, select Advanced, then set the Language and Format region options as you want.

Screenshot of the advanced request page with format region and language fields.

The page Report Limits and Settings now contains the columns Format Region and Language:

Screenshot of the report limits and settings.

FormatRegion property

As a report developer you can also determine which region needs to be used for a report. You can do this with the FormatRegion property. This property sets the format region that is used when formatting numbers and date/time values.

This allows the report developer to define region settings.

The format for the FormatRegion is based on RFC 4646 is languagecode2-country/regioncode2, where languagecode2 is the two-letter language code and country/regioncode2 is the two-letter subculture code. Examples include ja-JP for Japanese (Japan) and en-US for English (United States). In cases where a two-letter language code isn't available, a three-letter code as defined in ISO 639-3 is used.

The following report example implements the FormatRegion property:

```al-language
report 50200 MyReport
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultRenderingLayout = LayoutName;
    FormatRegion = 'nl-BE';
```   

There's a table named Language Selection. This table contains details for all available languages including the language tags (for example, En-US) and if they are enabled as localizations in the environment.

This can be used when using report objects in AL code.

The following is an example of a method that implements the Language Selection table to set the FormatRegion of a report:

Screenshot of the method to implement the language selection table to set format region.