Hi Guys one again. So far so good. but help me finish completly on this issue. I managed to download the pdf creator and install it. Now on the report to be ssved as pdf i wrote the following codes.
IF ISCLEAR(PDFCreator) THEN
CREATE(PDFCreator);
IF ISCLEAR(PDFCreatorError) THEN
CREATE(PDFCreatorError);
ReportID := REPORT::“Send Member Invoice Emails”;
IF Object.GET(Object.Type::Report,’’,ReportID) THEN;
FileDirectory := ‘C:’;
FileName2 := ‘INVOICES.PDF’;
PDFCreatorError := PDFCreator.cError;
IF PDFCreator.cStart(’/NoProcessingAtStartup’,TRUE) = FALSE THEN
ERROR(‘Status: Error[’ + FORMAT(PDFCreatorError.Number) + ']: ’ + PDFCreatorError.Description);
SalesHeader := “Sales Invoice Header”;
SalesHeader.SETRECFILTER;
IF Cust.GET (SalesHeader.“Sell-to Customer No.”) THEN BEGIN
IF Cust.“E-Mail” <> ‘’ THEN BEGIN
EmailAdd := Cust.“E-Mail”;
Window.OPEN(‘processing’);
WindowisOpen := TRUE;
IF FileName2 = ‘’ THEN
ERROR(‘Please specify what the file should be saved as’);
Object.GET(Object.Type::Report,’’,ReportID);
PDFCreatorOption := PDFCreator.cOptions;
//TEST PASSWORD
PDFCreatorOption.PDFUseSecurity :=1;
PDFCreatorOption.PDFOwnerPass := 1;
PDFCreatorOption.PDFOwnerPasswordString := ‘MasterPass’;
PDFCreatorOption.PDFDisallowCopy := 1;
PDFCreatorOption.PDFDisallowModifyContents := 1;
PDFCreatorOption.PDFDisallowPrinting := 1;
PDFCreatorOption.PDFUserPass := 1;
PDFCreatorOption.PDFUserPasswordString := ‘UserPass’;
PDFCreatorOption.PDFHighEncryption := 1;
//TEST PASSWORD
PDFCreatorOption.UseAutosave := 1;
PDFCreatorOption.UseAutosaveDirectory := 1;
PDFCreatorOption.AutosaveDirectory := FileDirectory;
PDFCreatorOption.AutosaveFormat := 0; //PDF file, you can also save in other formats
PDFCreatorOption.AutosaveFilename := FileName2;
PDFCreator.cOptions := PDFCreatorOption;
PDFCreator.cClearCache();
DefaultPrinter := PDFCreator.cDefaultPrinter;
PDFCreator.cDefaultPrinter := ‘PDFCreator’;
PDFCreator.cPrinterStop := FALSE;
REPORT.RUNMODAL(ReportID,FALSE,TRUE);
END;
END;
Now when i run the report am getting this error " Recursive function calls" Any bosy with any idea how to solve this?