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...
Suggested Answer

Change report title caption dynamically

(5) ShareShare
ReportReport
Posted on by 90
I have one report running on the same table. I want to change its caption based on the action I click on the page. If I click 1, the action should show the caption as A. If I click on action 2, it should be captioned as B.

Thanks in Advance
I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,421 Super User 2026 Season 1 on at

    Hi SabzZaman,

    To dynamically change the report title caption in Dynamics 365 Business Central based on the action clicked, you can follow this approach:

    1. Pass a Parameter to the Report:

      • Modify the report to accept a Text variable (e.g., ReportTitle) as a parameter.
      • This variable will hold the caption value (e.g., "A" or "B").
    2. Set the Parameter from the Page Action:

      • In the page extension, define two actions (Action 1 and Action 2).
      • In each action’s trigger, call the report and pass the appropriate caption value.

      Example:

    trigger OnAction()
    var
        ReportParameters: ReportRequest;
    begin
        ReportParameters.SetParameter('ReportTitle', 'A'); // or 'B'
        Report.Run(ReportID, ReportParameters);
    end;
     
    1. Use the Parameter in the Report Layout:

      • In the RDLC or Word layout, bind the ReportTitle variable to the title field.
      • This will display the correct caption based on the action clicked.

    Let me know if you'd like help implementing this in AL or customizing the layout!

    Best regards,
    Daniele

  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at
    Unfortunately, I don't think it is possible to change the Report Caption, we have this ability on the page but not on the reports.
  • Suggested answer
    RockwithNav Profile Picture
    9,113 Super User 2026 Season 1 on at
    I never tried this, just check if Report Caption entertains a variable, if it does we can or else we cannot.
     
  • Suggested answer
    Dhiren Nagar Profile Picture
    2,886 Super User 2026 Season 1 on at
    Hi, In AL Code while developing report you can only set the report caption as a string. Even Text variable is not allowed.
     
    So it is not possible to change the caption of the report dynamically.
     
    However as a workaround what you can do it to create 2 reports with different caption. It will consume one additional object of the report type.
    Finally you can link both the reports separately to the actions on the page you mentioned. Action 1 - Attach to Report with Caption A and action 2 - attach to report with caption B.
     
    This is not inherent solution but a workaround.
     
    I hope this helps.
     
    Regards,
    Dhiren.
  • Suggested answer
    Dynamics_Decoded_Gokul Profile Picture
    487 on at
    Hi, 

    I don't think we can do this with standard reports, But if the report is customized we can try out this approach 
     
    report 50100 "My Report"
    {
        UsageCategory = ReportsAndAnalysis;
        ApplicationArea = All;
        Caption = 'Default Caption'; // Fallback caption
        var
            DynamicCaption: Text[100];
        procedure SetReportCaption(NewCaption: Text[100])
        begin
            DynamicCaption := NewCaption;
        end;
        trigger OnInitReport()
        begin
            if DynamicCaption <> '' then
                CurrReport.Caption := DynamicCaption;
        end;
        dataset
        {
            dataitem(MyTable; "My Table")
            {
                // Columns here
            }
        }
    }



    Enable this as answered if it solves your request. 
  • Suggested answer
    Suresh Kulla Profile Picture
    50,278 Super User 2026 Season 1 on at
    @Tech_BC_Gokul, your suggested code is not possible, there is no property or method available on the report to set the caption.
  • Suggested answer
    YUN ZHU Profile Picture
    100,998 Super User 2026 Season 1 on at
    If it's a field caption, it can be made dynamic.
    As far as I know, it's not currently possible for page captions.
    More details: How to change field captions dynamically in Dynamics 365 Business Central
     
    So your solution is to create two reports with different captions, and then run different reports based on the conditions.
     
    Hope this helps.
    Thanks.
    ZHU
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,175 Super User 2026 Season 1 on at
    You can achieve this by passing a variable into the report through Report.Run or Report.RunModal from your action, then use that variable in the report to set the title dynamically (e.g., in OnPreReport or with a label/field bound to it). Essentially, your page action decides the caption, and the report picks it up.
     
    ✅ Mark this as the verified answer if helpful.
     
     

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 April 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,002 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,255 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,217

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans