MADHDA Business Solutions
  • Home
  • About Us
  • Services
    • Implementations
    • Support
    • Training
    • Upgrade
    • Business Analysis
  • Solutions
    • MS Dynamics 365 Business Central
    • MS Dynamics Nav
    • MS Dynamics 365 Sales/CRM
    • Power BI
    • Power Automation
  • Resources
    • Blog
  • Contact Us
  • Substituting a Report in Business Central

Substituting a Report in Business Central

7 November 2020

Substituting a Report in Business Central

Hello Philomaths,

Today,I came with widely used feature of business central.Contrary to pages and tables, extensibility is not yet supported for report objects in Business Central. Therefore, if you want to make any changes to the dataset or the layout of a base application report, you must create a new version of the report and apply the changes on the new object. Then you can override the base report with your own customized version by subscribing to the OnAfterSubstituteReport event published by Codeunit 44 – ReportManagement.

 the concept is to replace a report for another report through out the Business Central  / Dynamics NAV.

In following example , we replace standard “Assembly order ” report with our custom “Assembly Order New” report . Here we just need to subscribe an event and apply Report ID as parameter.

codeunit 50102 “Substitute Report”

{

    [EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, ‘OnAfterSubstituteReport’, ”, false, false)]

    local procedure OnSubstituteReport(ReportId: Integer; var NewReportId: Integer)

    begin

        if ReportId = Report::”Assembly Order” then

            NewReportId := Report::”Assembly Order New”;

    end;

}

When the “OnAfterSubstituteReport” event is raised, the event subscriber method is called and the replacement takes place.

So, When you run “Assembly Order” report through below action , this OnAfterSubstituteReport event raised and New custom report runs. This is what you want to do.

The OnAfterSubstituteReport event is raised when The user activates a page action that runs the report to be substituted, that is, an action that has the RunObject Property set to the report.

That’s all. Thanks for reading , I hope I explain well enough to understand the concept even though need any help contact me at my email Sagar@madhda.com

 

Previous post: Difference between “Preview” and “Preview & Close” button when running Reports in Business Central 17
Next post: SetLoadFields in Business Central

Categories

  • Microsoft Dynamics 365
  • Microsoft Dynamics Business central
  • Microsoft Dynamics NAV
  • Uncategorized

Recent Post

  • Ten reasons why you should move to Business Central
    March 12, 2021
  • Sending Email from Business Central Wave 2 2020
    December 26, 2020
  • Why ERP is must require for manufacturing and processing industries in modern business era?
    December 15, 2020
  • How To Use FlowField in Business Central?
    December 8, 2020
  • How to setup Jet Reports add-in in Business Central
    November 14, 2020
 

© Copyright 2020 | All Rights Reserved By MADHDA