Hi Folks -
I have created a processing report to run through the customer table and save a report as .PDF and then email the .PDF document. Everything works fine, email is sent and attachment is there but when you open the .PDF when email is received, it says cannot load file basically it has 0 bytes. Nothing is written to the blob file. Below is the code.
tempblob.blob.createoutstream(outstr);
FileName := SMTPSetup."Save PDF Report"+'Statement' + CustRecNew."No." + '.PDF';
Saved := REPORT.SAVEASPDF(50183,FileName,CustRecNew);
ServerFileName := FileMgt.UploadFileSilent(FileName);
FileMgt.BLOBExportToServerFile(Tempblob,FileName);
Can someone please help me out here. Any help is truly appreciated.
Thanks
RJ.
0
Comments
RecRef.GETTABLE(CustRecNew);
RecRef.SETRECFILTER;
REPORT.SAVEAS(REPORT::"50183",'',REPORTFORMAT::Pdf,OutStr,RecRef);
(or leave the recref, if report loops all customers)
tempblob.Blob.CREATEINSTREAM(Instr);
smtpmail.AddAttachmentStream(Instr,CustRecNew."No."+'.PDF');