Hello dear developers!
I have the following problem when generating a report and sending it.
I have created a job queue with my own codeunit.
This is about the Registered Delivery Reminders (table 5005272 - Issued Deliv. Reminder Header)
I select the records I need and get the email address from the vendor (table 23 Vendor).
The following code snippet gives me a headache:
RecRef.GetTable(IssuedDeliveryReminderRec);
TmpBlob.CreateOutStream(OutStr);
if (Report.SaveAs(5005273, '', Format::Pdf, OutStr, RecRef)) then begin
TmpBlob.CreateInStream(InStr);
TxtB64 := Cnv64.ToBase64(InStr, true);
EmailMsg.Create('mailadress@example.de', 'DeliveryReminder' + IssuedDeliveryReminderRec.Name, DescriptionFromIssuedDeliveryLine, false);
EmailMsg.AddAttachment('ReminderMail_' + IssuedDelNo + '' + IssuedDeliveryReminderRec.Name + '.pdf', 'application/pdf', TxtB64);
Email.Send(EmailMsg, Enum::"Email Scenario"::"Delivery Reminder");
end;
Sending the email to the different vendors works.
The error is that only one report is generated.
However, only one report with one header is generated. All the lines of the selected reports are displayed all together in the rows.
Example:
If I have selected 3 providers, a header is created and all lines of all 3 vendors end up in one report.
I have assumed that the report is generated and sent individually. To be sure I have cleared the used fields:
RecRef.Reset();
Clear(OutStr);
Clear(TxtB64);
Clear(InStr);
Has anyone ever tried something like this and could help me?
Thank you!
Faith