Adding Regional Formats to Reports in Dynamics 365 Business Central
D365 Business Central 2023 release wave 2 introduces regional formats for reports, which adds a new dimension of customization for reports. This feature gives you more flexibility to tailor how reports print, according to your unique needs. Addressing inherent limitations, such as the inability to customize region formats for specific reports, the absence of support for designating a specific format for Customers and Vendors, and the reliance on report format settings from My Settings, this enhancement simplifies the reporting experience in Business Central. In this article, we’ll dive into the mechanics of these changes and explore how they enhance the overall reporting process in Business Central.
Behavior and Priority Order
To understand how the new regional format feature works, let’s explore its behavior and order of priority. This insight will help you grasp how Business Central determines the language and format to use for reports in different situations, so you can adjust these settings to suit your business requirements.
1. Request Page: Advanced Settings Take Center Stage
The highest priority in the report generation process resides with the advanced settings on the report request page. When you generate a report, you can specify the language and format you want to use for the report.
2. Report Object in AL: Precise Configuration
The heart of the matter lies in the AL triggers associated with the report object. Reports now include two important properties: Report.Language and Report.FormatRegion. These properties, defined within the AL triggers, play a key role in configuring reports. For many standard document reports in the Base App, these properties are set based on the Language Code and Format Region fields from the document itself. These fields get their values from the corresponding entity settings. For example, the Sales Header report gets its settings from the customer entity.
3. Language and Format in Customer/Vendor Card
If a report should be printed in the language of the recipient rather than in the working language, the developer can add code in the report to handle this. This functionality is already enabled for most reports in the standard Business Central database. The document is printed in the language that is specified in the Language Code field on the Customer or Vendor Card page.
4. Language and Format in My Settings
If the report properties mentioned earlier aren’t configured within the AL triggers, Business Central then refers to the settings in My Settings. For example, consider a scenario where a regional format isn’t defined for a customer. In this case, when you print documents associated with the customer, the Report.FormatRegion property won’t have a specific regional format set. Consequently, Business Central will turn to the regional format setting in My Settings as a fallback. While My Settings had a more prominent role in earlier versions, its current function is to step in when no alternative settings are available.
By using this order of priority, Business Central ensures that the report output language and format are based on the most relevant and specific configurations. This approach gives you greater control over language and format customization for individual reports. Ultimately, this feature streamlines the reporting process, making it more efficient and user-centric.