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

Community site session details

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

How to Use 6 Custom Report Layouts with 6 Action Buttons in Payment Journal?

(0) ShareShare
ReportReport
Posted on by 74
Hi,
I created a report Extension  based on Report ID 2 (General Journal – Test) and added six different custom layouts.
I am using this report in the Payment Journal, where I added six custom action buttons, one for each layout.
Now I want to make this process dynamic so that all six action buttons can trigger their corresponding layout correctly.
Below is the code I’m using.
 
 rendering
    {
        layout("2-000001")
        {
          
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport1.rdl';
        }
        layout("2-000002")
        {
           
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport2.rdl';
        }
        layout("2-000003")
        {
           
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport3.rdl';
        }
        layout("2-000004") // changes-D----
        {
          
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport4.rdl';
        }
        layout("2-000005")
        {
           
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport5.rdl';
        }
        layout("2-000006")
        {
           
            Type = RDLC;
            LayoutFile = 'SRC/RDLC/testreport6.rdl';
        }
       
 
    }
 
This code is for a Page Extension and handles only one action button. Based on this, I need to add the remaining action buttons for the other report layouts
 
 action(Test1)
            {
                ApplicationArea = All;
                Caption = 'Test1';
                Image = Print;
                trigger OnAction()
                var
                    Genline: Record "Gen. Journal Line";
                    DesigntimeReportSelection: Codeunit "Design-time Report Selection";
                begin
                    Genline.Reset();
                    Genline.SetRange("Journal Template Name", Rec."Journal Template Name");
                    Genline.SetRange("Journal Batch Name", Rec."Journal Batch Name");
                    DesigntimeReportSelection.SetSelectedLayout('2-000001');
                    Report.Run(Report::"General Journal - Test", true, true, Genline);
                end;
            }
 
This code is working, but I need it to be dynamic.
 
 
I have the same question (0)

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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,665

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 3,060 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,976 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans