Business Central report layouts explained

This article is written for Business Central 2023 wave 2 (23) and later, and the ForNAV extensions version 7.3.0.0. and later.

In 2022, Microsoft released new pages for report layout administration, most notably the Report Layouts page. This new feature had its own tables that ran alongside the existing Custom Report Layouts for some time. From Business Central 2024 wave 1 (24), it became the default way of creating customized layouts for Business Central reports. All existing Custom Report Layouts were converted to these new tables. You can recognize this by the -CRL tag in the report layout name.

A screenshot of a computer

Description automatically generated

https://learn.microsoft.com/en-us/dynamics365-release-plan/2022wave1/smb/dynamics365-business-central/new-improved-pages-report-layout-administration

Because ForNAV depends heavily on report layouts, we have refactored ForNAV to only use these new report layouts. We have also created a new ForNAV report page to manage the report layouts and the layout selection. This article provides a deep dive into report layouts. What are they? Where are they stored? And what can you change?

What are report layouts?

A screenshot of a computer application

Description automatically generated

To explain this, we need to look at how reports are built up inside an extension. Every report inside an extension consists of two parts, the AL, or code file, and the layout file.

The AL file contains all the metadata and code to get the data from the database and to iterate over your dataset, it also contains your request page and all the code you need to run your reports.

The layout file contains all the information that ForNAV needs to render the report. All the text boxes, labels, barcodes, and images. But also, in some cases, information on how to get related data from your database.

The main difference between standard Business Central reports and ForNAV reports is that the ForNAV layout object is far more advanced than the standard Business Central Word or RDLC layouts. Things in regular Business Central reports that need to be done in the AL code can be done in the ForNAV layout files.

A diagram of a business application

Description automatically generated with medium confidence

These extension files are uploaded into Business Central. There are two types of extension, those you have control over, and those you do not have control over.

If you create your own extension, you control it. You can change the report code and the layout as much as you like and republish it every time you make a change.

There are also extensions that are published by Microsoft, or by independent software vendors (like ForNAV). These are pre-packaged extensions that you do not have control over. Therefore, you cannot change the report code and layout. This is an obvious disadvantage.

Extensions are typically created and installed by developers or technical consultants.

A screenshot of a computer

Description automatically generated

Of course, not being able to edit reports is a huge disadvantage and it is the reason why, in the past, most custom reports had to be created by developers as new report objects.

Some time ago, Microsoft created custom report layouts as a way of customizing reports, which have now been converted to the Report Layouts table. These are customized report layout files that are stored in the Business Central database. The main advantage of these layouts is that you don’t need to open an extension and work with Visual Studio Code to change your reports.

As explained earlier, the report layout files for ForNAV reports are far more advanced than the standard report layout files. This means that, with ForNAV reports, you rarely need to create new report extensions. If you have a ForNAV base report, then most customizations can be done inside a report layout by a functional consultant, or even an end user.

Working with report layouts in ForNAV

In this section, we will look at where these custom layouts are stored, and how you can edit them.

The report layouts can be created, edited, and selected in the Report Layouts page. The Report Layouts page will only show layouts for the current company; if a layout is created for another company, then it will not be visible here.

A screenshot of a computer

Description automatically generated

While this is a good starting point, at ForNAV we wanted to provide a better user experience. Firstly, it needs to be easier to create and edit reports. Therefore, we have created a new reports page specifically for ForNAV reports. To open the page click the report name.

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

On this new ForNAV reports page, you can see all the layouts that exist for this report. For most layouts, you can perform any action that you want. There are two exceptions:

  • The Built-In Layout – you can neither design nor delete the built-in layout because it is the layout that is defined by the developer in the ForNAV Customizable Report Pack extension. If you want to change the report layout, you need to create a copy of the built-in layout and design that.
  • The Layout to create an e-mail body – you cannot delete the layout to create an e-mail body, but you can design it.

Choose which layout you want to use

You can choose which layouts you want to use in a particular situation. Typically, the layout you choose in the Report Layouts page is the layout that is used, unless you override that layout for a specific use case.

To activate a specific layout for the current company, you can select the layout and click Activate. To activate a layout in a different company, you can activate it on the Activated Layouts fast tab.

A screenshot of a computer

Description automatically generated

This changes the layout that the report uses by default, but it does not tell Business Central when to use the report. For most Business Central usage areas, there are report selections where you can specify which report to use for which report usage. This is also the place where you can specify which layout Business Central should use for the email body. For instance, for a sales invoice, open the Report Selection Sales. On this page, you can specify the report layout and the email body layout.

A screenshot of a computer

Description automatically generated

After you have made this selection, the ForNAV report page will also show you the report selections where this report is used.

A screenshot of a report

Description automatically generated

Finally, there are different places where you can specify report layouts. For instance, in the customer document layouts page or in third-party apps like the Multiple Report Layout Selector.

Common issues

In an on-premise installation of Business Central, you might find that page 9660 (Report Layouts) cannot be found. Page 9660 is a new page that is included in the mandatory Microsoft app Exclude reportlayouts. You can install it from the Business Central installation DVD.