if Recipients.Count <> 0 then begin
TempBlob.CreateOutStream(OutS);
RecRef.GetTable(JobL);
Report.SaveAs(50114, ReportParameter, ReportFormat::Pdf, outs, RecRef);
ReportParameter := '';
ReportParameter := Report.RunRequestPage(50114);
TempBlob.CreateInStream(InS);
AttachmentTextL := AttachmentLbl;
SPCSetFileName(AttachmentTextL, Rec);
Attachment := StrSubstNo(AttachmentTextL, Rec."No.");
Subject := StrSubstNo(SubjectLbL, Rec."No.");
EmailMsgL.Create(Recipients, Subject, '', true);
EmailMsgL.AddAttachment(Attachment, 'application/pdf', InS);
Thanks for the replies, I have added , Runrequestpage, but when i click on cancel still its proceeding to email, how can i stop that.