/// <summary> /// Excels the specified employee collection. /// </summary> /// <param name="employeeCollection">The employee collection.</param> public void Excel(List <IEmployee> employeeCollection) { var title = "Report"; Response.ClearContent(); Response.BinaryWrite(generateDocument.GenerateExcel(employeeCollection, title)); Response.AddHeader("content-disposition", "attachment; filename=ExcelDocument.xlsx"); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.Flush(); Response.End(); }
public ActionResult Excel(List <TaxReturnView> taxReturnCollection) { var title = "Report"; Response.ClearContent(); Response.BinaryWrite(generateDocument.GenerateExcel(taxReturnCollection, title)); Response.AddHeader("content-disposition", "attachment; filename=Pitalytics.xlsx"); Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.Flush(); Response.End(); return(RedirectToAction("GenerateReport", "TaxReturn")); }