title: blank pdf report in production environment
body: <p>Everything works fine on my local machine and in our test site. Also both test and production sites have certificates installed. There is also an embedded image in the pdf report. I am not sure why it doesn't work in production as against the test site. In production it downloads a blank pdf file.</p>
  
  <p>This is the code:</p>
  
  <pre><code>            ReportDataSource reportDataSource = new ReportDataSource("objDataSet", models);
  
              localReport.DataSources.Add(reportDataSource);
              string reportType = "PDF";
              string mimeType;
              string encoding;
              string fileNameExtension;
  
              //The DeviceInfo settings should be changed based on the reportType
              //http://msdn2.microsoft.com/en-us/library/ms155397.aspx
              string deviceInfo =
              "&lt;DeviceInfo&gt;" +
              "  &lt;OutputFormat&gt;PDF&lt;/OutputFormat&gt;" +
              "  &lt;PageWidth&gt;8.5in&lt;/PageWidth&gt;" +
              "  &lt;PageHeight&gt;11in&lt;/PageHeight&gt;" +
              "  &lt;MarginTop&gt;0.5in&lt;/MarginTop&gt;" +
              "  &lt;MarginLeft&gt;0.75in&lt;/MarginLeft&gt;" +
              "  &lt;MarginRight&gt;0.75in&lt;/MarginRight&gt;" +
              "  &lt;MarginBottom&gt;0.5in&lt;/MarginBottom&gt;" +
              "&lt;/DeviceInfo&gt;";
  
              Warning[] warnings;
              string[] streams;
              byte[] renderedBytes;
  
              //Render the report
              renderedBytes = localReport.Render(
                  reportType,
                  deviceInfo,
                  out mimeType,
                  out encoding,
                  out fileNameExtension,
                  out streams,
                  out warnings);
              Response.Buffer = true;
              Response.Clear();
              Response.ContentType = mimeType;
              Response.AddHeader("content-disposition", "attachment; filename=abc." + fileNameExtension);
              Response.BinaryWrite(renderedBytes); // create the file
              Response.Flush(); // send it to the client to download
              return null;
  </code></pre>
  
  <p>From Fiddler Raw headers:</p>
  
  <p>PRO:</p>
  
  <p>HTTP/1.1 200 OK
  X-AspNetMvc-Version: 3.0
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Content-Type: application/pdf
  content-disposition: attachment; filename=abc.pdf
  Date: Wed, 23 May 2012 14:19:59 GMT
  Content-Length: 23975
  ETag: "pv11fd8c346df09ccc63c9a6c72b8b776d"
  Cache-Control: private, s-maxage=0
  X-PvInfo: [S10201.C11680.A12679.RA12754.G0.U59AB06B0].[OT/pdf.OG/documents]</p>
  
  <p>UAT:</p>
  
  <p>HTTP/1.1 200 OK
  Cache-Control: no-cache
  Content-Type: application/pdf
  X-AspNetMvc-Version: 3.0
  content-disposition: attachment; filename=abc.pdf
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  Date: Wed, 23 May 2012 14:59:46 GMT
  Connection: close
  Content-Length: 23681</p>
  
  <p>The mime type is set to .pdf : application/pdf</p>
  
  <p>Also an interesting thing I noticed was the file size of the pdf (23 KB)  is pretty much the same as I would get from my test website only difference being one pdf is completely blank the other filled with data.</p>