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:

sih_lr.SETRANGE(“No.”,‘INV0000001’);

sih_lr.FINDFIRST;

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

http://www.mibuso.com/forum/viewtopic.php?f=5&t=18331

http://blogs.msdn.com/b/nav-reporting/archive/2009/10/08/send-email-with-pdf-attachment-in-nav-2009.aspx

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