# Report extension object
> APPLIES TO: Business Central 2021 release wave 1 (v18.0) and later
With the report extension object, you can extend existing report objects, similar to how you extend tables and pages. With report extensions, you can extend an existing report by:
 Adding columns to existing data items in the report dataset
 Adding new data items
 Adding trigger implementations
 Adding to request pages
 Adding more report layouts, either to reflect new fields that are added with an extension, or simply adding new report layouts on an existing report dataset.
For a report to be extended, the Extensible property must be set to true, which is the default value. The value true, which means that reports by default can be extended, unless they explicitly have the Extensible property set to false. See properties/devenv-extensible-property.
> NOTE
> Extension objects can have a name with a maximum length of 30 characters.
## Report extension layout
From Business Central 2022 release wave 1, report extensions can have one or more layouts defined. See Defining Multiple Report Layouts<devenv-multiple-report-layouts>. The report layout of an existing report can't be extended, but new layouts can be added. To use an existing report as a starting point, you can download the layout from Business Central and include it in the extension project.
Layouts that are included in a report extension show up in Business Central as more layouts to the report. Layouts from a report extension are not automatically used when the extension is deployed. To use one of the new report layouts, go to the Report Layouts page in Business Central, and then choose the layout for the report in question as the new Default Layout.
## Snippet support
Typing the shortcut treportext creates the basic layout for a report extension object when using the AL Language extension for Microsoft Dynamics 365 Business Central in Visual Studio Code.
> TIP
> Use Ctrl+Space to trigger IntelliSense and get assistance on code completion, parameter info, quick info, and member lists. For more information about snippets, see Syntax and snippets<devenv-syntax>.
## Report extension example
The following example illustrates a simplified table extension, which adds a new field to the Customer table, MyField. The report extension MyExtension then adds MyField and an extra field in original Customer table to the Customer - Top 10 List report, and it adds a new Excel layout to the report. The example also illustrates how a new field added to the report extension, can be modified using the OnBeforeAfterGetRecord trigger. See OnBeforeAfterGetRecord (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforepredataitem-reportextensiondatasetmodify-trigger>. For a list of triggers that can be used inside the modify section of a report, go to the #related-information section.
For a more advanced example, see Report extension example<devenv-report-ext-example>.
> NOTE
> Inside the requestpage element, you cannot modify any properties.
> Using the OnInitReport trigger is not supported for report extensions. The OnPreReport and OnPostReport triggers are run after the original report's equivalent triggers.
```al
tableextension 50110 CustomerTableExt extends Customer
{
    fields
    {
        field(50100; MyField; Integer)
        {
            DataClassification = ToBeClassified;

        }
    }
}

reportextension 50110 MyExtension extends "Customer - Top 10 List"
{
    dataset
    {
        add(Integer)
        {
            // add existing field from base table to dataset
            column(fromBaseTable; Customer.GLN) { }
            // add field from table extending Customer
            column(fromBaseTableExt; Customer.MyField) { }
        }

        add(Customer)
        {
            // add a new field to the dataset
            column(netWeight; netWeight) { }
        }

        modify(Customer)
        {
            // modify the new, added field
            trigger OnBeforeAfterGetRecord()
            begin
                if (weightInPounds) then begin
                    netWeight := netWeight * 2.2;
                end else begin
                    netWeight := netWeight;
                end;
            end;
        }
    }

    requestpage
    {
        layout
        {
            addafter(Show)
            {
                // add field from table extension to request page
                field(fromBaseTableExt; Customer.myField) { }
            }
        }
    }

    // add additional report layouts to the report
    rendering
    {
        layout(MyExcelLayout)
        {
            Type = Excel;
            Caption = 'Top 10 customers (Excel)';
            Summary = 'Top 10 customers in my favorite analysis app: Excel';
            LayoutFile = 'Top10CustomersAsExcel.xlsx';
        }
    }

    trigger OnPreReport()
    begin
        // add code to run before the report is run, will be run after the original report's equivalent trigger
    end;

    trigger OnPostReport()
    begin
        // add code to run after the report is run, will be run after the original report's equivalent trigger
    end;

    var
        netWeight: Integer;
        weightInPounds: Boolean;

}
```
> TIP
> From the Business Central client, you can export report results as raw data to a Microsoft Excel file. The file contains all columns of the dataset, but without the layout applied. Use the file to help validate that the report returns the expected data, and to ensure that the report layout controls match the dataset value types. To export a report dataset to Excel, run the report and select the Send to > Microsoft Excel Document (data only) on the request page. See /ui-work-report#send-to-excel.
## Related information
Report extension example<devenv-report-ext-example>
Using request pages with reports<devenv-request-pages-for-reports>
Creating an Excel layout report<devenv-howto-excel-report-layout>
Creating an RDL layout report<devenv-howto-rdl-report-layout>
Creating a Word layout report<devenv-howto-report-layout>
Adding help links from pages, reports, and XMLports<devenv-adding-help-links-from-pages-tables-xmlports>
Page extension object<devenv-page-ext-object>
Page properties<properties/devenv-page-property-overview>
Developing extensions<devenv-dev-overview>
AL development environment<devenv-reference-overview>
Report extension triggers
OnPostReport (Report Extension) Trigger<triggers-auto/reportextension/devenv-onpostreport-reportextension-trigger>
OnPreReport (Report Extension) Trigger<triggers-auto/reportextension/devenv-onprereport-reportextension-trigger>
OnAfterAfterGetRecord (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafteraftergetrecord-reportextensiondatasetmodify-trigger>
OnAfterPostDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafterpostdataitem-reportextensiondatasetmodify-trigger>
OnAfterPreDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafterpredataitem-reportextensiondatasetmodify-trigger>
OnBeforeAfterGetRecord (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforeaftergetrecord-reportextensiondatasetmodify-trigger>
OnBeforePostDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforepostdataitem-reportextensiondatasetmodify-trigger>
OnBeforePreDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforepredataitem-reportextensiondatasetmodify-trigger>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-ext-object, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-report-ext-object/
