Guest User

Untitled

a guest
Jul 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. byte[] byteInfo = workbook.SaveToMemory(FileFormat.OpenXMLWorkbookMacroEnabled);
  2. workStream.Write(byteInfo, 0, byteInfo.Length);
  3. workStream.Position = 0;
  4. return workStream;
  5.  
  6. byte[] byteInfo = workbook.SaveToMemory(FileFormat.OpenXMLWorkbookMacroEnabled);
  7.  
  8. void StreamExcelFile(byte[] bytes)
  9. {
  10. Response.Clear();
  11. Response.ContentType = "application/force-download";
  12. Response.AddHeader("content-disposition", "attachment; filename=name_you_file.xls");
  13. Response.BinaryWrite(bytes);
  14. Response.End();
  15. }
Add Comment
Please, Sign In to add comment