title: Print report directly, without print dialogue box and report viewer
body: <p>I need to print my reports directly to printer:</p>
  
  <p>1) Without showing print dialogue box</p>
  
  <p>2) Without showing the Reportviewer</p>
  
  <p>I was suggested the following code:</p>
  
  <pre><code>Dim printerSettings As New PrinterSettings()
      Dim printDialog As New PrintDialog()
      printDialog.PrinterSettings = printerSettings
      printDialog.AllowPrintToFile = False
      printDialog.AllowSomePages = True
      printDialog.UseEXDialog = True
      Dim result As DialogResult = printDialog.ShowDialog()
  
      If result = DialogResult.Cancel Then
          Return
      End If
  
      Me.rptSalesReport.PrintOptions.PrinterName = printerSettings.PrinterName
      Me.rptSalesReport.PrintToPrinter(printerSettings.Copies, False, 0, 0)
  </code></pre>
  
  <p>But I am receiving error on the last two lines, where I put the name of my reports,
  rptSalesReport.  It says:</p>
  
  <pre><code>rptSalesReport is not defined.
  </code></pre>
  
  <p>While the rptSalesReport is there in my project and I can view it through report viewer.
  Please advise.
  Thanks</p>