{"title":"Report extension object","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/devenv-report-ext-object/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-report-ext-object","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"The report extension object in AL for Business Central allows you to create an extension of an existing report.","date":"2024-11-11","meta":{"topic":"article"},"outline":[{"level":1,"title":"Report extension object","slug":"report-extension-object","at":0,"chars":7703},{"level":2,"title":"Report extension layout","slug":"report-extension-layout","at":938,"chars":791},{"level":2,"title":"Snippet support","slug":"snippet-support","at":1729,"chars":418},{"level":2,"title":"Report extension example","slug":"report-extension-example","at":2147,"chars":3633},{"level":2,"title":"Related information","slug":"related-information","at":5780,"chars":1923}],"text":"# Report extension object\n> APPLIES TO: Business Central 2021 release wave 1 (v18.0) and later\nWith 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:\n Adding columns to existing data items in the report dataset\n Adding new data items\n Adding trigger implementations\n Adding to request pages\n 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.\nFor 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.\n> NOTE\n> Extension objects can have a name with a maximum length of 30 characters.\n## Report extension layout\nFrom 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.\nLayouts 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.\n## Snippet support\nTyping 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.\n> TIP\n> 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>.\n## Report extension example\nThe 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.\nFor a more advanced example, see Report extension example<devenv-report-ext-example>.\n> NOTE\n> Inside the requestpage element, you cannot modify any properties.\n> Using the OnInitReport trigger is not supported for report extensions. The OnPreReport and OnPostReport triggers are run after the original report's equivalent triggers.\n```al\ntableextension 50110 CustomerTableExt extends Customer\n{\n    fields\n    {\n        field(50100; MyField; Integer)\n        {\n            DataClassification = ToBeClassified;\n\n        }\n    }\n}\n\nreportextension 50110 MyExtension extends \"Customer - Top 10 List\"\n{\n    dataset\n    {\n        add(Integer)\n        {\n            // add existing field from base table to dataset\n            column(fromBaseTable; Customer.GLN) { }\n            // add field from table extending Customer\n            column(fromBaseTableExt; Customer.MyField) { }\n        }\n\n        add(Customer)\n        {\n            // add a new field to the dataset\n            column(netWeight; netWeight) { }\n        }\n\n        modify(Customer)\n        {\n            // modify the new, added field\n            trigger OnBeforeAfterGetRecord()\n            begin\n                if (weightInPounds) then begin\n                    netWeight := netWeight * 2.2;\n                end else begin\n                    netWeight := netWeight;\n                end;\n            end;\n        }\n    }\n\n    requestpage\n    {\n        layout\n        {\n            addafter(Show)\n            {\n                // add field from table extension to request page\n                field(fromBaseTableExt; Customer.myField) { }\n            }\n        }\n    }\n\n    // add additional report layouts to the report\n    rendering\n    {\n        layout(MyExcelLayout)\n        {\n            Type = Excel;\n            Caption = 'Top 10 customers (Excel)';\n            Summary = 'Top 10 customers in my favorite analysis app: Excel';\n            LayoutFile = 'Top10CustomersAsExcel.xlsx';\n        }\n    }\n\n    trigger OnPreReport()\n    begin\n        // add code to run before the report is run, will be run after the original report's equivalent trigger\n    end;\n\n    trigger OnPostReport()\n    begin\n        // add code to run after the report is run, will be run after the original report's equivalent trigger\n    end;\n\n    var\n        netWeight: Integer;\n        weightInPounds: Boolean;\n\n}\n```\n> TIP\n> 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.\n## Related information\nReport extension example<devenv-report-ext-example>\nUsing request pages with reports<devenv-request-pages-for-reports>\nCreating an Excel layout report<devenv-howto-excel-report-layout>\nCreating an RDL layout report<devenv-howto-rdl-report-layout>\nCreating a Word layout report<devenv-howto-report-layout>\nAdding help links from pages, reports, and XMLports<devenv-adding-help-links-from-pages-tables-xmlports>\nPage extension object<devenv-page-ext-object>\nPage properties<properties/devenv-page-property-overview>\nDeveloping extensions<devenv-dev-overview>\nAL development environment<devenv-reference-overview>\nReport extension triggers\nOnPostReport (Report Extension) Trigger<triggers-auto/reportextension/devenv-onpostreport-reportextension-trigger>\nOnPreReport (Report Extension) Trigger<triggers-auto/reportextension/devenv-onprereport-reportextension-trigger>\nOnAfterAfterGetRecord (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafteraftergetrecord-reportextensiondatasetmodify-trigger>\nOnAfterPostDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafterpostdataitem-reportextensiondatasetmodify-trigger>\nOnAfterPreDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onafterpredataitem-reportextensiondatasetmodify-trigger>\nOnBeforeAfterGetRecord (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforeaftergetrecord-reportextensiondatasetmodify-trigger>\nOnBeforePostDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforepostdataitem-reportextensiondatasetmodify-trigger>\nOnBeforePreDataItem (Report Extension Data Set Modify) Trigger<triggers-auto/reportextensiondatasetmodify/devenv-onbeforepredataitem-reportextensiondatasetmodify-trigger>"}