How to use OnBeforeSetReportLayout

RogerRoger Posts: 58Member
Hi,

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

Answers

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

    sample:
    [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)
        begin
            if ReportId = report::"Job Create Sales Invoice" then
                NewReportId := report::JobCreateSalesInvoice_MyOne;
        end;
    
Sign In or Register to comment.