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.
The 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.
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:\temp\50111.rdl’);
myfile.CREATEINSTREAM(myInStream);
ReportForNav.LoadRdlc(myInStream);
myfile.CLOSE();
Layouts loaded in this fashion can be created using the ForNAV designer. You simple save the layout to an rdl file.
Indlægget Change the report layout at runtime blev vist første gang den ForNAV.