Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] byteSI = p.GenerateReportBinary();
- //2.
- string filename = Server.MapPath("~/Temp/SI_TermTakaful.pdf");
- File.WriteAllBytes(filename, byteSI);
- Session["PdfUrl"] = byteSI;
- ScriptManager.RegisterStartupScript(this, GetType(), "Show Modal Popup", "showmodalpopup();", true);
- if (Session["PdfUrl"] != null)
- {
- string filename = Session["PdfUrl"].ToString();
- Context.Response.Buffer = false;
- FileStream inStr = null;
- byte[] buffer = new byte[1024];
- long byteCount; inStr = File.OpenRead(filename);
- while ((byteCount = inStr.Read(buffer, 0, buffer.Length)) > 0)
- {
- if (Context.Response.IsClientConnected)
- {
- Response.ContentType = "application/pdf";
- Context.Response.OutputStream.Write(buffer, 0, buffer.Length);
- Context.Response.Flush();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement