I am currently having huge issues with the android environment with a pdf export. i am using a report viewer control to render a report in to an array of bytes. Next i am using response.binarywrite method to output the byte stream to the browser. This works in every browser as well as iphone and ipad. However, it will not work on android.
The Pdf says that it is corrupted. When i open the pdf in notepad i see that it is exporting my entire page html instead of the byte array generated by the report viewer.
the code:
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
string filename = "attachment; filename=Data.pdf";
byte[] bytes = ReportViewer1.ServerReport.Render(
"PDF", null, out mimeType, out encoding,
out extension,
out streamids, out warnings);
Response.Buffer = true;
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", filename);
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();