ReportViewer Report for PDF Files
Using Winforms, C #,. Net 3.5 and Microsoft ReportViewer 2008:
I have a 3 page report in the 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 to split the pages or specify which page to display in PDF? He knows there are 3 pages ... so it seems like there must be something, but I haven't found it yet.
Thanks for the help in advance!
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);
}
+2
a source to share