Options

How to DOWNLOAD and display automatically file from server

VotucVotuc Member Posts: 206
edited 2010-10-07 in NAV Three Tier
Hello,

I have code that saves a report to PDF on the server, then attaches the PDF report to an email. (based on this blog).

My client wants the PDF to always display so it can be printed. How can I add the DOWNLOAD command to do this?

                  REPORT.SAVEASPDF(206, 'C:\temp\'+STRSUBSTNO('Invoice No. %1.pdf',"No.")+'.pdf', SalesInvHeader);
                  SalesInvHeader.SETRANGE("Posting Description",'Order ' + "No.");
                  SalesInvHeader.FIND('-');
                  Cust.SETRANGE("No.",SalesInvHeader."Sell-to Customer No.");
                  Cust.FIND('-');
                  emailtoaddr := Cust."E-Mail";
                  
                  Mail.NewMessage(emailtoaddr,emailccaddr,STRSUBSTNO('Invoice No. %1',"No."),
      'Attached please find invoice ' + "No." +'.','\\'+Hostname+'\C$\temp\'+STRSUBSTNO('Invoice No. %1.pdf',"No.")+'.pdf',TRUE)

Answers

  • Options
    SavatageSavatage Member Posts: 7,142
    You mean you want it to open the PDF after?
    How about
    Hyperlink('your path&filename.pdf');
  • Options
    VotucVotuc Member Posts: 206
    HYPERLINK worked! Thank you! =D>

    For future reader's benefit I used:
    HYPERLINK('C:\temp\'+STRSUBSTNO('Invoice No. %1.pdf',"No.")+'.pdf');
    

    which worked with the code above. It opened right up into Adobe PDF.
Sign In or Register to comment.