6.2 Report Layouts: RDLC, Word, Excel & Multilanguage
Key Takeaways
- Modern AL reports utilize the rendering block with layout elements specifying Type (RDLC, Word, Excel) and LayoutFile, controlled by DefaultRenderingLayout.
- RDLC layouts consume the flat DataSet_Result using Tablix data regions with row/column groupings, aggregate functions (First, Sum), and =ReportItems!ControlName.Value expressions to display dynamic body data in page headers.
- Microsoft Word layouts map Custom XML Parts (urn:microsoft-dynamics-nav/reports/...) to Plain Text and Repeating Section Content Controls, excelling at letterhead and correspondence formatting but requiring AL pre-calculation for running totals.
- Excel layouts inject the raw dataset into a protected Data worksheet, enabling self-service modeling with pre-designed Pivot Tables, Pivot Charts, Slicers, and =SUMIFS() formulas on separate analysis sheets.
- The labels block defines localizable string constants that appear in layout datasets as ReportLabel elements and integrate directly with XLIFF (.xlf) multi-language translation files, dynamic runtime language switching (CurrReport.Language), and regional formatting (CurrReport.FormatRegion).
6.2 Report Layouts: RDLC, Word, Excel & Multilanguage
Once a report's dataset is constructed in AL, Business Central requires a layout engine to format, style, and render the raw data into human-readable documents or analytical workbooks. Business Central supports three distinct built-in layout technologies—RDLC (Report Definition Language Client), Microsoft Word, and Microsoft Excel—as well as tenant-level user customizations.
1. Modern Layout Architecture: The rendering Block
Starting with Business Central 2022 Release Wave 2 (runtime 10.0+), the modern and recommended approach for declaring layouts in AL is the rendering block. This architecture decouples reports from a single hardcoded layout and allows multiple layout definitions within the same report object.
report 50105 "Standard Sales Invoice"
{
DefaultRenderingLayout = StandardRDLC;
ApplicationArea = Basic, Suite;
UsageCategory = Documents;
dataset
{
// DataItems and Columns
}
requestpage
{
// Request page definition
}
rendering
{
layout(StandardRDLC)
{
Type = RDLC;
LayoutFile = './src/reports/layouts/SalesInvoice.rdlc';
Caption = 'Standard Sales Invoice (RDLC)';
Summary = 'Standard corporate invoice layout with precision headers and tax breakdown.';
}
layout(WordTemplate)
{
Type = Word;
LayoutFile = './src/reports/layouts/SalesInvoice.docx';
Caption = 'Editable Word Invoice Template';
Summary = 'Clean, modern Word template for customer-facing communication.';
}
layout(ExcelAnalysis)
{
Type = Excel;
LayoutFile = './src/reports/layouts/SalesInvoiceAnalysis.xlsx';
Caption = 'Sales Invoice Data Analysis';
Summary = 'Raw dataset with pre-configured Pivot Tables and Margin charts.';
}
}
}
Comparison of Layout Engines
| Capability / Feature | RDLC Layout | Word Layout | Excel Layout |
|---|---|---|---|
| Primary Use Case | Precision transactional documents (Invoices, Checks, Barcode labels). | Customer-facing documents requiring letterhead or prose styling. | Financial modeling, data exploration, pivot summaries, charts. |
| Authoring Tool | Microsoft Report Builder / Visual Studio Report Designer. | Microsoft Word desktop app with XML Mapping Pane. | Microsoft Excel desktop application. |
| Repeating Data | Tablix (Table, Matrix, List) with Grouping. | Repeating Section Content Control. | Data worksheet populated row-by-row; Pivot Tables. |
| Header/Footer Context | Complex headers using ReportItems! expressions. | Native Word headers/footers (repeats first page/all pages). | Excel print titles and sheet headers. |
| Interactive Features | Drilldown toggles, document maps, sorting. | None (static rendered document). | Pivot slicers, formulas (SUMIFS), interactive charts. |
| Rendering Formats | PDF, Preview, Physical Printer. | PDF, DOCX, Preview, Physical Printer. | XLSX (direct Excel download). |
Extension Layouts vs. Tenant Custom Report Layouts
Business Central differentiates between built-in layouts supplied by extensions and custom layouts created by tenant administrators:
- Built-in Layouts: Defined in the AL
renderingblock or extension manifest. They are immutable and deployed with the.apppackage. - Tenant Custom Layouts (
Report Layoutspage): Users can navigate to the Report Layouts page in the Web Client, select any report, and export its layout file (RDLC, Word, or Excel). After modifying the file locally, the user uploads it back to Business Central as a custom tenant layout. Users can designate custom layouts as the company default without modifying AL extension code.
2. RDLC Layout Design Mechanics
RDLC layouts represent Report Definition Language files rendered on the client or server using the Microsoft Reporting Services engine.
+-----------------------------------------------------------------------+
| RDLC REPORT LAYOUT |
| +-----------------------------------------------------------------+ |
| | Page Header: [=First(Fields!CompanyName.Value, "DataSet_Result")]| |
| +-----------------------------------------------------------------+ |
| | Body: Tablix Data Region | |
| | +----------------+---------------+---------------+----------+ | |
| | | Header Group | Order No: [=Fields!OrderNo.Value] | | |
| | +----------------+---------------+---------------+----------+ | |
| | | Details Row | [ItemNo] | [Description] | [Amount] | | |
| | +----------------+---------------+---------------+----------+ | |
| | | Footer Group | Total: [=Sum(Fields!Amount.Value)] | | |
| | +----------------+---------------+---------------+----------+ | |
| +-----------------------------------------------------------------+ |
| | Page Footer: Page [=Globals!PageNumber] of [=Globals!TotalPages]| |
| +-----------------------------------------------------------------+ |
+-----------------------------------------------------------------------+
Key RDLC Design Principles
- The Single Dataset Rule: In RDLC, all data arrives in one flat table named
DataSet_Result. You reference fields with=Fields!FieldName.Value. - Tablix Controls: A Tablix is the universal data region. It combines Table, Matrix (cross-tab), and List functionalities. Developers establish Parent/Child Row Groups (e.g., grouping by
OrderNo) and detail rows for line items. - Aggregation Expressions: When referencing parent data inside group headers or summaries, use aggregate functions:
=First(Fields!CustomerName.Value, "OrderNoGroup"): Retrieves the customer name for the active group.=Sum(Fields!LineAmount.Value, "OrderNoGroup"): Calculates group totals.
- Visibility & Conditional Formatting: Controls can be hidden dynamically using Boolean expressions in the
Hiddenproperty:=IIf(Fields!Quantity.Value = 0, True, False). - The Page Header Limitation: RDLC does not allow direct field references (
=Fields!Field.Value) inside page headers or footers. To display dynamic data (such as the active invoice number) in a page header, developers place a hidden textbox in the body and reference it in the header using=ReportItems!HiddenTextBoxName.Value.
3. Microsoft Word Layout Design
Word layouts provide an intuitive approach for creating editable, customer-facing business documents using Microsoft Word's standard formatting tools.
Designing Word Layouts via the XML Mapping Pane
- Generate the initial Word layout file by compiling the AL report in VS Code (
Ctrl+Shift+B), which outputs the.docxschema shell specified inLayoutFile. - Open the
.docxfile in Microsoft Word and enable the Developer ribbon tab. - Open the XML Mapping Pane and select the Custom XML Part corresponding to the report namespace:
urn:microsoft-dynamics-nav/reports/<ReportName>/<ReportID>/. - Mapping Single Fields: Insert a Plain Text Content Control into table cells or paragraphs where scalar values (e.g.,
CompanyName,PostingDate) should appear. - Mapping Repeating Tables (Lines): Highlight the entire table row designated for line items, right-click the parent
Linenode in the XML Mapping Pane, and select Insert Content Control > Repeating Section.
Exam Watchout — Word Layout Limitations: Word layouts excel at visual design and typography, but they lack advanced computational capabilities. Running totals across pages, complex multi-dataset grouping, and page-count-dependent logic cannot be calculated natively inside Word; such calculations must be computed in AL prior to dataset emission.
4. Microsoft Excel Layouts & Multilanguage Labels
Excel Layout Engine Mechanics
Excel layouts enable self-service business intelligence and financial reporting directly from Business Central report datasets:
- When an Excel layout report executes, Business Central writes the entire flattened dataset into a worksheet named Data.
- Developers can design secondary worksheets containing Pivot Tables, Pivot Charts, and Excel formulas (
=SUMIFS(...),=XLOOKUP(...)) that reference the Data sheet. - When the user runs the report from the Web Client, the NST injects the fresh dataset into the Data sheet and triggers Excel's automatic formula/pivot cache refresh upon opening.
Multilanguage Labels in Reports
To ensure report layouts support multilingual deployments without hardcoding English text into RDLC or Word files, AL provides the labels block.
report 50105 "Standard Sales Invoice"
{
// ...
labels
{
InvoiceTitleLbl = 'TAX INVOICE', Comment = 'Document title printed in header';
SubtotalLbl = 'Subtotal Amount', MaxLength = 30;
VATHdrLbl = 'VAT Breakdown Summary';
ThankYouMsgLbl = 'Thank you for your business!';
}
}
- Labels defined in the
labelsblock are automatically emitted as dataset fields in the layout schema with the suffixCaption(e.g.,InvoiceTitleLblCaption). - The translation compiler extracts these labels into the extension's
.xlftranslation files, allowing localization into dozens of languages. - In AL code triggers, developers can dynamically adjust the report's language and region formatting based on customer preferences using
CurrReport.Language := Language.GetLanguageIdOrDefault(Customer."Language Code");andCurrReport.FormatRegion := Customer."Format Region";.
In modern Business Central development (runtime 10.0+), how should an AL developer configure a report to provide an RDLC layout, a Microsoft Word layout, and an Excel layout within a single report object, while designating the RDLC layout as default?
When designing an RDLC layout in Microsoft Report Builder or Visual Studio, which expression syntax correctly retrieves the value of the 'CustomerNo' column from the report dataset inside a Tablix table cell?
A developer is designing a Microsoft Word document layout for a sales order report. To ensure that sales order lines repeat dynamically for every item on the order, how should the table row in the Word document be configured using the XML Mapping Pane?
When developing an Excel layout report in Business Central, where does the Business Central server runtime place the generated tabular dataset inside the downloaded Excel workbook?