title: View RDLC Report as pdf in Asp.net MVC
body: <p>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...</p>
  
  <pre><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;
          }           
      }
  </code></pre>
  
  <p>The pdf file exported to User->AppData->Temp </p>
  
  <pre><code>            string filePath = System.IO.Path.GetTempFileName();
              string ack = Export(rpt, Server.MapPath("~/Reports/Mymun_Lab/ComparisonStudy.rdlc"));                
              System.Diagnostics.Process.Start(filePath);
  </code></pre>
  
  <p>I want to render this pdf file to the client PC.</p>
  
  <p>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.</p>
  
  <p>Thanks In Advance...</p>