How to use OnBeforeSetReportLayout

RogerRoger Posts: 49Member

I found this function 'OnBeforeSetReportLayout' in Table 77 in NAV2018. Is it possible to change the report who should be print before the report runs? Coudl anyone tell me please how to use this function?

Thanks a lot.
Many thanks, Roger


  • JuhlJuhl Posts: 661Member
    It’s used by eventsubscriber to change the layout of the report. Not the report itself.
    Follow me on my blog
  • Remco_ReinkingRemco_Reinking Posts: 72Member
    To change the report to run, you can use Codeunit::"Reporting Triggers", event: SubstituteReport

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Reporting Triggers", 'SubstituteReport', true, true)
    local procedure RunMyReport(ReportId: Integer; RunMode: option Normal,ParametersOnly,Execute,Print,SaveAs,RunModal; RequestPageXml: Text; RecordRef: RecordRef; VAR NewReportId: Integer)
            if ReportId = report::"Job Create Sales Invoice" then
                NewReportId := report::JobCreateSalesInvoice_MyOne;
Sign In or Register to comment.