One of the awesome new features of Microsoft Dynamics 365 Business Central 2021 Wave 1 (version 18) is the ability to extend reports. In this video I explore the simplest reportextension possible, adding a single field to the dataset of the standard invoice report.
In this post we will go through the steps to create a simple RDLC report from scratch, now I know that most of the time you would copy a standard report and not create your reports from scratch, however I feel that it is important to understand the basics of how a report is created, to help you be most efficient.
One of the noisy limitations on Dynamics 365 Business Central until version 17.X was the impossibility to extend standard reports. If you want to add a simple new field to a standard report, you are forced to create an entire new report (new dataset), maybe from scratch or (better) by manually copying the standard dataset into a new .al file and then modifying it. You cannot handle the report dataset as an “extendible” object open for contributions between extensions.
Today’s post covers some programming that is not of my own making. My colleague Andreas Rascher has built a damn cool functionality that allows you to export the dataset of RDLC reports in different formats. Since we think the functionality is extremely useful, we didn’t want to keep it from you.
On the Business Central Cloud, to save a report in PDF format and change its name while saving, you can use a STREAM BLOB through the “Temp blob” codeunit.
Once this is done, use the function then the BLOBExport function present in the “File Management” codeunit to export the report created with the “REPORT.SAVEAS” command, changing its name during saving.
Do you love reports? Personally, NO! 🙂 But that is, as a Business Central developer I think that sometimes (forced or not) you need to work with reports in your solutions.
As a quick recap, in Dynamics 365 Business Central a report layout controls content and format of the report, including which data fields of a report dataset appear on the report and how they are arranged, text style, images, and more.