22. Oktober 2021 11:32
XMLParameter:= REPORT.RUNREQUESTPAGE(50107);
CustTempTable.Picture.CREATEOUTSTREAM(OStream,TEXTENCODING::UTF8);
CustTempTable.Picture.CREATEINSTREAM(IStream,TEXTENCODING::UTF8);
REPORT.SAVEAS(50107,XMLParameter,REPORTFORMAT::Pdf,OStream);
CLEAR(SMTPMail);
SMTPMail.CreateMessage('Navi','nav@xxx.at','abcr@xxx.at','Bericht','',TRUE);
SMTPMail.AddAttachmentStream(IStream,'Customer Invoice.pdf');
SMTPMail.AppendBody('This is a system generated mail. Please do not reply to this mail!');
SMTPMail.Send;
MESSAGE('Mail gesendet!');
22. Oktober 2021 12:15
25. Oktober 2021 21:39
XMLParameter:= REPORT.RUNREQUESTPAGE(50107);
IF ISCLEAR(WshShellTempPath) THEN
CREATE(WshShellTempPath, TRUE, TRUE);
TmpFolder := WshShellTempPath.ExpandEnvironmentStrings('%TEMP%');
FinalFileName := TmpFolder + '\Report_50107.pdf';
FileManagement.ServerCreateDirectory('C:\temp\Navision_Temp_Reports');
Filename := 'C:\temp\Navision_Temp_Reports\Report_50107.pdf';
Content.CREATE(Filename);
Content.CREATEOUTSTREAM(OStream);
REPORT.SAVEAS(50107,XMLParameter,REPORTFORMAT::Pdf,OStream);
Content.CLOSE;
FileManagement.DownloadToFile('C:\temp\Navision_Temp_Reports\Report_50107.pdf',FinalFileName);
Mail.NewMessage('manfred.steinbacher@scheucher.at','','',MailBetreff,MailText,FinalFileName,TRUE);
FileManagement.ServerRemoveDirectory('C:\temp\Navision_Temp_Reports',TRUE);
25. Oktober 2021 22:56