public ActionResult ExportLeadTimingReport(JLRReportSearchCriteriaViewModel searchCriteria)
{
OperationResponse<DataTable> LeadTimingReport = new OperationResponse<DataTable>();
LeadTimingReport.Value = new DataTable();
byte[] file = LeadManager.GetJLRLeadTimingReportForExport(searchCriteria);
HttpContext.Response.ClearContent();
HttpContext.Response.Clear();
HttpContext.Response.Buffer = true;
HttpContext.Response.AddHeader("content-disposition", "attachment; filename=Export.xlsx");
HttpContext.Response.ContentType = "application/force-download";
HttpContext.Response.Charset = "";
HttpContext.Response.BinaryWrite(file);
HttpContext.Response.End();
return null;
}
Returns empty excel file. But binary array contains data, but when its called it gives blank excel file.