Business Central: Modifying Reports

One of the things you notice when getting started with Business Central extensions is the sample first App walk-through includes Table Extensions and Page Extensions. It does not include extensions for reports. Likewise, the documentation for reports does not include a report extension object. There’s a good reason for this: report extensions don’t exist, at least as of the October 2019 Wave 2 Release. It has been added to the request list by several.

So what if you need to add something to a report? I’d suggest this approach.

If the data you want to add to the report is standard Business Central data such as the External Document Number, start with this first approach. If the data you want to add is not standard Business Central data, for example if it comes from a table extensions that you created, go directly to the second approach.

First Approach To Report Customization

First, go to Report Layouts in Business Central; select the report you want to update. Also notice whether the default report is Word or RDLC. Now choose Process > Custom Layouts. You will see the screen below.

On the Custom Layouts page, select New, then click the New… menu item. This report is an RDLC layout, so select the RDLC layout as shown.

Copying a Business Central Report built-in layout.

Press OK, and you will see a list view, with report 9 added. On this list view, select the report, then select Layout > Export Layout. This will export the RDLC layout, which you can open with Microsoft Report Builder.

If you do not have this loaded on your system already, you can download it from the Microsoft website.

On the left-hand side of the report, expand the dataset until you can see column names. Look through these column names to see if the data you want to add to the report is present. Examining an RDLC report's dataset in Microsoft Report Builder.Note that as I mentioned above, if you have added data to Business Central, it will not be shown here. If you find the field that you are trying to add, use Microsoft report builder to add it.

Once you have made the modification, go back into Business Central. On the Custom Report Layouts Page, choose Layout > Import. Once you have done this, choose Update Layout from the same layout menu. You should now be able to run the report with the new layout. This is also the method that you would use to change fonts or other styles in a report.

Business Central Report Modification When Easy Does Not Work

If this method does not work because you are trying to add data to report that is not on the dataset list, will have to use the VS Code development environment configured for AL as described here.

If you are using Business Central 14 or Dynamics NAV 2018, you will need to export the report object from the database and convert it to AL. That process is described here.

If you are using Business Central 15 (October 2019, Wave 2), take a look at the on-premise installation ISO. In the Application directory, you will find the code for the BaseApp reports in the BaseApp directory. There are also some other interesting source files in this directory.

To find the report we have been working on, you will need to unzip the BaseApp source code and find the report file which in this case is called TrialBalanceBudget.Report.al. If you copy this into your own AL project (recommended), you will also want the report layout file TrialBalanceBudget.rdlc. You will have to change both the name and the report number, and I recommend that you change the caption (in the AL file) to reflect the fact that the report has been customized.

Applying the New Report In Business Central

You can use this technique of copying and changing the source code for any report in the base application. Then publish these as extensions, and use Page Extensions to place them on any pages where the reports appear. To find these pages, you can open the full AL BaseApp code in the development environment and do a text search. Of course, the most common things will be changing are probably things like Sales Orders and Purchase Orders, and these can simply be changed on the report selection set up for the appropriate module.

Let us know if we can help you with this, and have fun customizing Business Central.