ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Codeunit 9651 "Document Report Mgt."

Open sirhc101 opened this issue 7 years ago • 2 comments

Hi there,

Long time ago (see [Event Request] Table 77 Report Selection, SaveReportAsPDF #2353) I started to develop a module to merge company specific stationery (pdf) to a report (Sales Invoice, Order Confirmation, etc.) created from BC. That time I requested a new event publisher, but to honest, at the wrong place. @StanPesotskiy guided me that time to use OnBeforeMergeDocument publisher in Document Report Mgt. codeunit and initially it looked good. Because of other projects I needed to postpone and when I continued I found out, that I can't use this or any other existing publisher, because at this time you're handling with word files/streams only.

Therefor I would like to request the following modifications.

  1. Please add the ReportID (integer) as an Parameter to ConvertToPdf() procedure.
  2. Add a OnAfter publisher inside of ConvertToPdf()
    local procedure ConvertToPdf(var TempBlob: Codeunit "Temp Blob"; ReportID: Integer)
    begin
        if not TryConvertWordBlobToPdf(TempBlob) then
            Error(CompanyInformationPicErr);
        OnAfterConvertToPdf(TempBlob, ReportID);
    end;

    [IntegrationEvent(false, false)]
    local procedure OnAfterConvertToPdf(var TempBlob: Codeunit "Temp Blob"; ReportID: Integer)
    begin
    end;

There are just two references calling ConvertToPdf procedure, one in PrintWordDoc() and one in MergeWordLayout(). At both you already have the ReportID.

It would be great If you could at this small change.

Thanks in advance.

sirhc101 avatar Oct 10 '19 16:10 sirhc101

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Oct 30 '19 17:10 bc-ghost

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Nov 12 '19 10:11 bc-ghost