PFD file is not getting created for last few days.

Trying to create a PDF file. File was being created in the past but now for last few days the same file is not getting created(NAV 2009 r2). Also, when i am attaching the same file on mail i am getting the following error :-

"Attachment E:
CBD Files
Cash and Bank Day Book April 5.pdf does not exist or can not be accessed from the program"

The folder has got all the permissions still facing the issue for last few days. Please guide me how to proceed or what can be done or some other way to sort it out.

Code:-

Name1 := STRSUBSTNO(‘Cash and Bank Day Book %1.pdf’, FORMAT(CALCDATE(’-1D’,TODAY),0,’ '));
ToFile1 := Name1;
Filename1 :=‘F:\CBD Files’+ToFile1;
REPORT.SAVEASPDF(REPORT::“Day Bank Cash Book Rpt”, Filename1);

SMTPCU1.CreateMessage(
Text005,Text000,Text000,Name1,Text007, FALSE);
SMTPCU1.AddAttachment(Filename1);
SMTPCU1.Send;
FILE.ERASE(Filename1);

Correction:-
Filename1 :=‘E:\CBD Files’+ToFile1;

Hi,
As you are saying that file was generating earlier and its not generating now.

Please check and reply -

  1. Did you applied any Hotfix in database?
  2. Does the Report still have a layout (For using SaveasPDF report should have a layout).
  3. First try to just save the file using Report.SaveAsPDF.
  4. Also try to run the report using RTC Client and save Report as pdf.

Hi,

  1. Did you applied any Hotfix in database? :- No.
  2. Does the Report still have a layout (For using SaveasPDF report should have a layout). :- Yeah it has a layout.
  3. First try to just save the file using Report.SaveAsPDF. :- Yeah tried the same but the file is not generating in that folder.
  4. Also try to run the report using RTC Client and save Report as pdf.:- Yup the file is saved as PDF.

Hi,
For Point 3 -
Does folder exist in service tier (E:\CBD Files)?

hi,

Yeah the folder exist in the server itself.

Regards
Samarth

Hi,
Can you try running the Codeunit / Report from Service Tier directly.
My Thought is - If the code was working earlier then it might be system issue not the code related. I am trying to figure out where the problem is.
Please Run the Codeunit / Report from Service Tier Directly and see the file is getting generated or not.

You should also verify that the actual NST user actually as access to your files.

Yeah access is to everyone.

You mean to run the report from RTC??

Yes i mean run the code for saving report from service tier. not the RTC Report.
You have some code to save it to PDF right so execute that from NST machine.