title: How to generate pdf report automatically in Dynamics NAV
body: <p>I have designed a report and i would like to save each report in pdf into a specifi folder. How do i achieve this using a codeunit or report?</p>
  
  <pre><code>Number:=50050;
   CustBill.RESET;
  IF CustBill.FIND('-') THEN
  tofile := DELCHR(CustBill."Customer No." +    FORMAT(CustBill.Date),'=','/\:.,') + '.pdf';
  Filename := 'D:\Bills\'+'tofile';
  REPORT.SAVEASPDF(Number, Filename,Runrpt)
  </code></pre>