How to use OnBeforeSetReportLayout

RogerRoger Member Posts: 57
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 Member Posts: 724
    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 Member Posts: 74
    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.