public async Task <ActionResult> ExportToExcelFile(AdvancedSearchViewModel advancedSearchViewModel) { if (advancedSearchViewModel.AccountID == 0) { advancedSearchViewModel.AccountID = this.Identity.ToAccountID(); } advancedSearchViewModel.PageNumber = 1; ExportSearchResponse exportResponse = await advancedSearchService.ExportSearchToExcelAsync(new ExportSearchRequest() { SearchViewModel = advancedSearchViewModel, FileType = "Excel", DateFormat = this.Identity.ToDateFormat(), TimeZone = this.Identity.ToTimeZone() }); string fileKey = Guid.NewGuid().ToString(); bool result = cachingService.StoreTemporaryFile(fileKey, exportResponse.byteArray); Logger.Current.Informational("Did temporary file stored in cache : " + result.ToString()); return(Json(new { success = true, fileKey = fileKey, fileName = exportResponse.FileName }, JsonRequestBehavior.AllowGet)); }