IF ISCLEAR(BullZipPDF) THEN
CREATE(BullZipPDF);
ReportID := REPORT::"Sales Invoice";
FileDirectory := 'C:\temp';
Window.OPEN('Processing Customer ######################1##');
Object.GET(Object.Type::Report,'',ReportID);
Window.UPDATE(1,"No.");
PDFFileName := "No." + '.pdf';
BullZipPDF.Init;
BullZipPDF.LoadSettings;
RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE);
BullZipPDF.SetValue('Output',FileDirectory+PDFFileName);
BullZipPDF.SetValue('Showsettings', 'never');
BullZipPDF.SetValue('ShowPDF', 'no');
BullZipPDF.SetValue('ShowProgress', 'no');
BullZipPDF.SetValue('ShowProgressFinished', 'no');
BullZipPDF.SetValue('SuppressErrors', 'yes');
BullZipPDF.SetValue('ConfirmOverwrite', 'no');
BullZipPDF.WriteSettings(TRUE);
Customer2 := "SMTP Customer";
Customer2.SETRECFILTER;
REPORT.RUNMODAL(ReportID,FALSE,FALSE,Customer2);
TimeOut := 0;
WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN
SLEEP(1000);
TimeOut := TimeOut + 1;
END;
Window.CLOSE;
CLEAR(SMAIL);
SMAIL.CreateMessage(Name,EMail,EMail,"No."+'SubSMTP',"No."+'BSMTP',FALSE);
SMAIL.AddAttachment(FileDirectory+"No."+'.pdf');
SMAIL.Send;
Answers
ERASE(FileName)
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I'm getting this error message
you cannot use the file C:\temp\1000.pdf because it is already in use.
code used aswel, I tried to use sleep
code used
this code is taking long time and not responding
am I doing wrong?
please correct me
Thanks
Regards
Chowdary
correction to the code
WHILE EXISTS(FileDirectory+"No."+'.pdf') AND (TimeOut1 < 10) DO BEGIN
it's TimeOut1, not TimeOut
corrected code
with this code, it's giving the same error, i.e.,
you cannot use the file C:\temp\1000.pdf because it is already in use.
depending on the sleep it's taking time to give error message
Thanks
Regards
Chowdary
Remember to change the code in codeunit 400 to include the port no, and also call the Dispose after the SEnd function.
Soren
http://gotcal.com
could you add a .txt of that cu400? when will microsoft release an update?
the hotfix shows this, thx.
Thanks Mohana