title: SSRS: How to print a report without bringing up the rendered report?
body: <p>I'm wondering how to print a SSRS report without bringing up a report viewer. Right now my users have to press the Print button, bring up the rendered report, and then press Print again.</p>
  
  <p>Current Code:</p>
  
  <pre><code>Dim report as new ReportViewer
  'snip - fill datasets, set data sources, blah blah blah
  report.ReportViewer1.LocalReport.DataSources.Add(datasource)
  report.Show()
  </code></pre>
  
  <p>This brings up a viewer window, which I don't really want, since my users then have to press Print again.</p>
  
  <p>So I added the following:</p>
  
  <pre><code>report.PrintDialog()
  </code></pre>
  
  <p>The above code results in an <code>invalidOperationException</code> because it hasn't finished rendering. I understand that, but is there a way to render the report programmatically (rather than onscreen) and send the user straight to the printer dialogue?</p>
  
  <p>EDIT: OK, I'm 90% there. <code>PrintDialog()</code> isn't the way to go. I found <a href="http://www.codeproject.com/KB/reporting-services/MicrosoftReportsII.aspx" rel="nofollow">this article</a> but it results in an <code>InvalidXMLException</code>. It doesn't tell me why it's wrong, just that it's wrong... The API is totally unhelpful so... help?</p>