I am getting below error when generating a report via C/AL,
Microsoft Dynamics NAV
---------------------------
Could not find a part of the path 'D:\EmailPDF\PSI_1617_0222.pdf'.
---------------------------
OK
---------------------------
This is the code which I have written,
CLEAR(InvoiceReport);
InvoiceReport.USEREQUESTPAGE(FALSE);
InvoiceReport.SetInvoiceNo(InvNo); ------> Have set filter for invoice no., by sending the parameter.
FOR i := 1 TO STRLEN(InvNo) DO BEGIN
IF (InvNo[i] = '/') OR
(InvNo[i] = '\') OR
(InvNo[i] = '-') OR
(InvNo[i] = '.') THEN
InvNo[i] := '_';
END;
FileName := 'D:\EmailPDF\'+ InvNo +'.pdf';
InvoiceReport.SAVEASPDF(FileName);
*This post is locked for comments