private void CreatePDF(string fileName)
{ // Variables
Warning[] warnings;
string[] streamIds;
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
// Setup the report viewer object and get the array of bytes
ReportViewer viewer = new ReportViewer();
viewer.ProcessingMode = ProcessingMode.Local;
viewer.LocalReport.ReportPath = "RmsReport.rdlc";
byte[] bytes = viewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
// Now that you have all the bytes representing the PDF report, buffer it and send it to the client.
Response.Buffer = true; Response.Clear(); Response.ContentType = mimeType;
Response.AddHeader("content-disposition", "attachment; filename=" + fileName + "." + extension);
Response.BinaryWrite(bytes); // create the file
Response.Flush(); // send it to the client to download }
still report is showing excel,word format
Loading

Rahul BansalPosted Feb 26, 2015, 6:24 AM
https://msdn.microsoft.com/en-us/library/ms251670%28v=vs.90%29.aspx
http://www.c-sharpcorner.com/UploadFile/a20beb/getting-started-with-reports-in-net/