Declare report layouts in the rendering section, not with the legacy layout properties
Since runtime 9.0 (BC20), reports declare layouts in a rendering section of named layout entries, each with Type, LayoutFile, Caption, and Summary, and choose the default by name with DefaultRenderingLayout.
- microsoftlayer
- reportingdomain
- 2examples
- 1pull request
Rule on GitHub · microsoft layer · reporting · BC 20.. · tier official · derived
Description
Since runtime 9.0 (BC20), reports declare layouts in a rendering section of named layout entries, each with Type, LayoutFile, Caption, and Summary, and choose the default by name with DefaultRenderingLayout. The older properties DefaultLayout, RDLCLayout, WordLayout, and ExcelLayout allow only one layout per type, select the default by type, and Microsoft documents that they should be avoided because they will be deprecated. Code that reads them also loads the full layout into memory even when it only checks whether a layout of that type exists.
Agents still produce the legacy properties because most published samples and older Base Application code use them.
Best Practice
In new or changed reports, declare every layout in rendering, set DefaultRenderingLayout on the report, and give each layout a Caption and Summary so users can choose between them on the Report Layouts page. When touching a report that still uses the legacy properties, convert it with the AL code action Convert to ‘Rendering’.
See sample: declare-report-layouts-in-the-rendering-section.good.al.
Anti Pattern
A new report, or a changed report’s layout declaration, that uses DefaultLayout together with RDLCLayout, WordLayout, or ExcelLayout.
Do not flag unchanged legacy declarations in code outside the review scope, or projects whose target runtime is below 9.0.
See sample: declare-report-layouts-in-the-rendering-section.bad.al.
References
DefaultLayout property (avoid the legacy properties; they will be deprecated; reading them loads the full layout), Declare report layouts in AL, and Defining multiple report layouts.
Examples
- Good: declare-report-layouts-in-the-rendering-section.good.al
- Bad: declare-report-layouts-in-the-rendering-section.bad.al
Changed by
From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).