I am facing problem in last two days. I am trying to view rdlc report as pdf without reportviewer. I export rdlc to pdf using the following code...
public string Export(LocalReport rpt, string filePath) { string ack = ""; try { Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; byte[] bytes = rpt.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings); using (FileStream stream = File.OpenWrite(filePath)) { stream.Write(bytes, 0, bytes.Length); } return ack; } catch(Exception ex) { ack = ex.InnerException.Message; return ack; } }
The pdf file exported to User->AppData->Temp
string filePath = System.IO.Path.GetTempFileName(); string ack = Export(rpt, Server.MapPath("~/Reports/Mymun_Lab/ComparisonStudy.rdlc")); System.Diagnostics.Process.Start(filePath);
I want to render this pdf file to the client PC.
This Code is work fine on my local machine. But when i publish this to IIS Server and run for try to get the exported pdf file to client PC not success. How can i solve this issue. Can anyone help me.
Thanks In Advance...