Converting RDLC reportviewer output to PDF Manually

Posted by Sksamantaray under ASP.NET category on | Points: 40 | Views : 3815
Sometimes we need to convert out Report output to pdf and at the same time we do not require to show the Report Header.
So report-viewer output has to be converted to pdf manually. For that you can refer to following code.

 public void createPdfReport()


Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
byte[] bytes = this.ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);
FileStream fs = new FileStream(@"c:\filename.pdf", FileMode.Create);
fs.Write(bytes, 0, bytes.Length);

protected void Button1_Click1(object sender, EventArgs e)

Comments or Responses

Login to post response