web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
New Discussion

Multiple Report Preview: things to REALLY know

(2) ShareShare
ReportReport
Posted on by Microsoft Employee

Since Dynamics 365 Business Central 2020 Wave 2 (version 17.x) it is now possible to run multiple report preview without the need of launching the request page multiple times.

See the official enhancement entries

https://docs.microsoft.com/en-us/dynamics365-release-plan/2020wave2/smb/dynamics365-business-central/report-request-page-open-multiple-previews

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-request-pages#defining-a-requestpage-section

 

This brand new experience is driven by the SaveValues Request Page property

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-savevalues-property

 

Together with SaveValues, since version 17.2, there is a new Report property that influence the multiple report preview: AllowScheduling.

https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-allowscheduling-property

 

The Multiple Report Previews creates NEW Report object instances every time the request page runs. This implies all the triggers will be re-executed every time from scratch.

Therefore, there is a trade-off if you are in need to use consistently the report and request page triggers (e.g. OnInitReport, OnOpenPage).

 

To showcase the remarkable differences within the execution, you might create a simple page extension and a report as per the following

 

pageextension 50110 "Employee List Extension" extends "Employee List"

{

    actions

    {

        addafter("Ledger E&ntries")

        {

            Action(RunMultiplePreviewReport)

            {

                Caption = 'Run Multiple Preview Report';

                Promoted = true;

                PromotedIsBig = true;

                Image = Report;

                PromotedCategory = Process;

                ApplicationArea = All;

 

                trigger OnAction();

                var

                    Employee: Record Employee;

                    MultiplePreviewReport: Report "Multiple Preview Report";

                    ActionTextVar : Text;

                begin

                    ActionTextVar := 'WhateverValue';

                    Employee.SetRange("No.",Rec."No.");

                    if Employee.FindFirst() then begin

                        MultiplePreviewReport.SetTableView(Employee);

                        MultiplePreviewReport.SetTextVar(ActionTextVar);

                        MultiplePreviewReport.RunModal();

                    end;

                end;

            }

        }

    }

}

 

report 50110 "Multiple Preview Report"

{

    DefaultLayout = RDLC;

    ApplicationArea = All;

    UsageCategory = ReportsAndAnalysis;

    RDLCLayout = 'DummyLayout.rdl';

 

    //This value is disabling Multiple Preview Feature (if set to false)

    AllowScheduling = false;

 

    dataset

    {

        dataitem(EmployeeDataItem; Employee)

        {

            column(No_;"No.") {}

            column(GlobalTextVar;GlobalTextVar) {}

            column(OnInitReportVar;OnInitReportVar) {}

            column(OnOpenPageVar;OnOpenPageVar){}

 

            trigger OnAfterGetRecord()

            begin

                Message('OnAfterGetRecord:[%1][%2][%3]',GlobalTextVar,OnInitReportVar,OnOpenPageVar);

            end;

        }

    }

    requestpage

    {

        //This value enable Multiple Report Preview (if set to true)

        SaveValues = true; 

 

        trigger OnOpenPage();

        begin

            OnOpenPageVar := Random(50000);

            Message('OnOpenPage:[%1][%2][%3]',GlobalTextVar,OnInitReportVar,OnOpenPageVar);

        end;

    }

 

    trigger OnInitReport();

    begin

        OnInitReportVar := random(50000); 

        Message('OnInitReport:[%1][%2][%3]',GlobalTextVar,OnInitReportVar,OnOpenPageVar);

    end;

 

    procedure SetTextVar(var LocalTextVar: Text);

    begin

        GlobalTextVar := LocalTextVar;

    end;

 

    var

        GlobalTextVar: Text;

        OnInitReportVar : Integer;

        OnOpenPageVar: Integer;

}

 

with a simple RDL file to show the output in a Tablix within the body (well, this is not necessary, since the same is reported through messages)

 pastedimage1610122348038v1.png

 

Now, let's play with AllowSchedule \ SaveValues parameter and take note of the outcome.

When doing some stuff before running the report it has some very important considerations and side effects (see NOTE column).

 

AllowSchedule\SaveValues

Preview button type

OnInitReport

OnOpenPage

OnAfterGetRecord

NOTE

TRUE\TRUE

Preview

No-Yes-No

Yes-Yes-Yes

No-Yes-Yes

OnInitReport and OnOpenPage will be executed multiple times. No messages are thrown. Values from the first OnOpenPage will be different from the OnAfterGetRecord because of the new report object creation.

TRUE\FALSE

Preview & Close

No-Yes-No

Yes-Yes-Yes

Yes-Yes-Yes

Every value will be consistent / the same and triggers executed just one time

FALSE\FALSE

Preview & Close

No-Yes-No

Yes-Yes-Yes

Yes-Yes-Yes

Every value will be consistent / the same and triggers executed just one time

FALSE\TRUE

Preview & Close

No-Yes-No

Yes-Yes-Yes

Yes-Yes-Yes

Every value will be consistent / the same and triggers executed just one time

 

Again, this remarks the trade off between SaveValues vs run the report consistently in all the experiences (print / preview / schedule).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,024 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,145 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 705 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans