public virtual IActionResult ExportReportContractUnfinish(ReportContractUnfinishSearchModel searchModel) { if (!string.IsNullOrEmpty(searchModel.stringConstructionIds)) { var lstConstruction = searchModel.stringConstructionIds.Split(',').ToList(); searchModel.SelectedConstructionIds = lstConstruction.Select(c => (int)c.ToNumber()).ToList(); } try { var report = _reportService.GetReportContractUnfinishes(ConstructionIds: searchModel.SelectedConstructionIds, time: searchModel.time); byte[] bytes; using (var stream = new MemoryStream()) { _exportManager.ExportContractUnfinish(report, stream, Convert.ToDateTime(searchModel.time)); bytes = stream.ToArray(); } return(File(bytes, MimeTypes.TextXlsx, "BaoCaoSLDoDang.xlsx")); } catch (Exception exc) { ErrorNotification(exc); return(RedirectToAction("List")); } }