Build layouts for operational and document reports
After you establish a reliable dataset, you choose how users consume it. The layout type should match the output structure, editing workflow, and runtime behavior rather than the developer's preferred authoring tool.
Choose a layout for the output
Business Central reports support Word, Excel, and report definition language (RDL) layouts. One report can declare several layouts, which lets the dataset serve more than one presentation need.
| Layout | Best fit | Design considerations |
|---|---|---|
| Word | Letters, invoices, and other flowing documents | Content controls map dataset fields into repeating sections. Word supports familiar document authoring and pagination that follows document content. |
| Excel | Analysis, reconciliation, and interactive workbooks | Worksheets use report data for tables, formulas, charts, and pivot analysis. Design for data exploration rather than fixed printed pages. |
| RDL | Precisely positioned lists, matrices, grouping, and print output | The layout controls groups, expressions, visibility, page breaks, and repeated headers with detailed rendering rules. |
For a document hierarchy, map header fields outside the repeating line region and line fields inside it. For operational output, keep detail columns at a consistent grain and group only when the business requirement calls for subtotals or sections. Define totals from numeric dataset values instead of preformatted text so the layout engine can aggregate them.
Pagination also follows the report's purpose. A customer letter might start each customer on a new page. An operational list might repeat column headings and avoid unnecessary page breaks. Test with empty groups, one-record groups, and groups that span several pages.
Declare layouts with modern rendering syntax
Use the rendering section as the implementation pattern for layouts. It keeps multiple layouts together and gives each layout a caption and summary that users see on the Report Layouts page.
report 70400 "Customer Balance Review"
{
DefaultRenderingLayout = CustomerWord;
dataset
{
dataitem(Customer; Customer)
{
column(CustomerNo; "No.") { }
column(CustomerName; Name) { }
column(BalanceLCY; "Balance (LCY)") { }
}
}
rendering
{
layout(CustomerWord)
{
Type = Word;
LayoutFile = 'CustomerBalanceReview.docx';
Caption = 'Customer balance document';
Summary = 'A formatted customer balance document.';
}
layout(CustomerExcel)
{
Type = Excel;
LayoutFile = 'CustomerBalanceReview.xlsx';
Caption = 'Customer balance analysis';
Summary = 'An interactive workbook for balance analysis.';
}
}
}
DefaultRenderingLayout identifies the developer-provided default for a report object. The layout file becomes part of the extension package. During development, the AL compilation option generateReportLayout can create a layout file from the dataset when you build the project.
Separate developer and administrator responsibilities
The developer defines the dataset and supplies built-in layouts. In the Business Central client, an administrator uses Report Layouts and Report Layout Selection to manage available layouts and choose which layout a report uses. A custom layout can adapt presentation without changing AL or the dataset contract.
Treat dataset column names as an interface. Removing or renaming a column can break a built-in or custom layout that refers to it. Additive changes are usually easier to adopt, but each layout still needs validation against the updated dataset.
Layouts supplied by a report extension appear as available layouts after deployment. Business Central doesn't select a report-extension layout automatically. A user or administrator selects it on the Report Layouts page, or installation and upgrade code applies it when that behavior is part of the extension design.
Before release, test every supported layout, the data-only Excel export, filters, long text, large record sets, and page boundaries. For implementation details, see Create an Excel layout report, Create an RDL layout report, and Manage report and document layouts.