SAVEASPDF does not save, always returns FALSE

Hello all,

I have an issue where I am trying to send an smtp email with an attachment nightly. It runs the code and doesn’t break, however it does not save the file either. Here is the code for the saveaspdf functionality:



tofile := DELCHR(sih_lr.“No.” + FORMAT(WORKDATE),’=’,’/:.,’) + ‘.pdf’;

FileName := ‘C:\temp’+tofile;

test:=REPORT.SAVEASPDF(REPORT::“Custom Sales Invoice”,FileName,sih_lr);

I have made sure that my temp file has full access, anything else that I am missing?

It only works in the Role Tailored Client. Are you in Classic?

Ah, yes I was doing the testing in classic, is there a way I could do this to interact with the job queue or would I need to use something else to save the pdf to then attach to the smtp email.

where do you need it? classic or RTC?

check below posts

I am trying to run this directly from the service tier as part of the job queue not manually.