public IActionResult OnPostCreateExcel() { var excel = new Excel(new SimpleExcelConfig()); var dbToExcel = new DbToExcel(_context); excel.CreateStartExcel(dbToExcel.CreateGroupInfos()); excel.AddCouplesToExcel(dbToExcel.CreateCoupleInfos(false), dbToExcel.CreateGroupInfos()); var fs = new FileStream(excel._excelFileTmpPath.FullName, FileMode.Open, FileAccess.Read); return(File(fs, "application/msexcel", "Raspisanue.xlsx")); //return RedirectToPage("./Index"); }