title: Print Sales Quotation report to PDF AX 2009
body: <p>I am currently on AX 2009 SP1 Rollup 7. I am attempting to create a PDF when my method is ran sending a quotation Id from the CustQuotationJour table to the SalesQuotation report. </p>
  
  <p>The method works OK, but the report is sent to the Print Preview screen instead of creating a PDF.  I assume its SalesQuotation report resetting my print setting reverting back to screen. My guess is within the fetch method, but I shouldn't have to modify this, right?</p>
  
  <p>Is there another print setting that I may be missing? 
  Thanks in advance </p>
  
  <pre><code>ReportRun                   salesQuotationReport;
  Args                        args = new Args();
  PrintJobSettings            printJobSettings;
  CustQuotationJour           custQuotationJour;
  ;
  
  custQuotationJour = CustQuotationJour::findFromSalesQuotationQuotation(_quotationId);
  
  
  args.name(reportStr(SalesQuotation));
  args.record(custQuotationJour);
  salesQuotationReport = new ReportRun(args);
  salesQuotationReport.init();
  
  printJobSettings = salesQuotationReport.printJobSettings();
  printJobSettings.setTarget(PrintMedium::File);
  printJobSettings.preferredTarget(PrintMedium::File);
  printJobSettings.format(PrintFormat::PDF);
  printJobSettings.preferredFileFormat(PrintFormat::PDF);
  printJobSettings.fileName(_path);
  
  salesQuotationReport.unpackPrintJobSettings(printJobSettings.packPrintJobSettings());
  salesQuotationReport.run();
  </code></pre>