public FileContentResult Download() { string filePath = @"D:\SalesEdge\"; string fileName = "DataLakeProviders" + DateTime.Now.ToString("yyyy_MM_dd") + ".xlsx"; string providerReportPath = filePath + fileName; var fileDownloadName = String.Format(fileName); const string contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; if (System.IO.File.Exists(providerReportPath)) { System.IO.File.Delete(providerReportPath); } ProviderManager UM = new ProviderManager(); ProviderDataView UDV = UM.GetUserDataView(); // Pass data to method ExportToExcel ee = new ExportToExcel(); ee.GenerateExcelFile(UDV.ProviderUserProfile.ToList(), providerReportPath); byte[] file = System.IO.File.ReadAllBytes(providerReportPath); var fsr = new FileContentResult(file, contentType); fsr.FileDownloadName = fileDownloadName; return(fsr); }
public ProviderDataView GetUserDataView() { ProviderDataView UDV = new ProviderDataView(); List <ProviderUserView> profiles = GetAllUserProfiles(); UDV.ProviderUserProfile = profiles; return(UDV); }
public ActionResult ManageUserPartial() { //if (User.Identity.IsAuthenticated) //{ ProviderManager UM = new ProviderManager(); ProviderDataView UDV = UM.GetUserDataView(); return(PartialView(UDV)); //} //return View(); }