Change the report layout at runtime
With Reports ForNAV, you can change the used report layout at runtime. This means that you can load a layout, which you have stored in a file or a blob field and use that instead of the default layout.
This feature was introduced because a ForNAV customer wanted to change the invoice layout based on the items or customer on the invoice. However, this can be used for a lot of other things too.
To use this feature, you simply add a couple of lines in your code to load the layout. In the code snippet shown below, a new layout is loaded from a file. This code was added to the OnInitReport trigger.
myfile.OPEN(‘c:temp50111.rdl’);
myfile.CREATEINSTREAM(myInStream);
ReportForNav.LoadRdlc(myInStream);
myfile.CLOSE();
Layouts loaded in this way can be created using the ForNAV Designer. You simply save the layout to an rdl file.
Latest news
Latest knowledge base articles
-
AI Assistant in the ForNAV Designer (beta)
-
Mapping from Business Central documents to ZUGFeRD and XRechnung
-
Using native Business Central ZUGFeRD generation with FORNAV reports
-
Repeater tables and barcodes in the ForNAV Template Editor
-
Controlling report language, format region, copies, and watermark with the Report Settings page
