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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Select Print Report

(0) ShareShare
ReportReport
Posted on by 55

Hello, 

When a customer want to print a quote, he should be to choose between 2/3 different reports (For exemple, one report with price, another without price, ...) 

I use this code to let the choice when printing. 

pageextension 50101 "Sales Order Ext" extends "Sales Order"
{
    layout
    {
        // Add changes to page layout here
    }

    actions
    {
        modify("Print Confirmation")
        {
            Visible = false;
        }
        addafter("Pick Instruction")
        {
            action(MyCustomAction)
            {
                ApplicationArea = All;

                Caption = 'My Print Confirmation';


                trigger OnAction()
                var
                    Selection: Integer;
                    OptionMembersLbl: Label 'Report 204,Report 205,Report 206';
                    optionInstructionLbl: Label 'Choose one of the following';
                begin
                    Selection := Dialog.StrMenu(OptionMembersLbl, 2, optionInstructionLbl);
                    case Selection of
                        0:
                            exit; //  User clicked on Cancel
                        1:
                            Report.Run(204);
                        2:
                            Report.Run(205);
                        3:
                            Report.Run(206);
                    end;
                end;
            }
        }

    }

    var
        myInt: Integer;
}

It's work if the report doesn't have the same id. 

How can I do to let the choice between different report with the id 204 ?

Thanks for your help.

Maxence

I have the same question (0)
  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Sorry, not so clear the question to me and maybe I've not understood. If the report ID is 204, it's one single object. You can have more choices that points to the single report, like:

    case Selection of

    0,1: Report.Run(204).

  • Maxence Profile Picture
    55 on at

    For the Quote, I have 4 different layout (1304 - Quotes)

    QuoteReport.PNG

    I would like to have the choice between the 4 reports 1304 when I'm printing.

    It's it possible to do this ?

    Thanks.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Choosing when printing is not a standard possibility. You should dinamycally change the layout based on conditions.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,742

#2
YUN ZHU Profile Picture

YUN ZHU 844 Super User 2025 Season 2

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 719 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans