title: ReportViewer report to PDF files
body: <p>Using Winforms, C#, .Net 3.5, and Microsoft ReportViewer 2008:</p>
  
  <p>I have a 3 page report in ReportViewer that I want to send to PDF as different pages. I have the code below that will copy all 3 pages to PDF but is there a way of splitting up the pages or specifying which page to render into PDF? It knows there are 3 pages... so seems like there should be something but I've not found it yet.</p>
  
  <p>Thanks for the help in advance!</p>
  
  <pre><code>int numPages = reportViewer.LocalReport.GetTotalPages();
  
  byte[] bytes = reportViewer.LocalReport.Render(
     "PDF", null, out mimeType, out encoding, out filenameExtension,
     out streamids, out warnings);
  
  using (FileStream fs = new FileStream(exportPath, FileMode.Create))
  {
     fs.Write(bytes, 0, bytes.Length);
  }
  </code></pre>