diff --git a/Bank/BankClientApp/Controllers/HomeController.cs b/Bank/BankClientApp/Controllers/HomeController.cs index f24006e..27e7ac3 100644 --- a/Bank/BankClientApp/Controllers/HomeController.cs +++ b/Bank/BankClientApp/Controllers/HomeController.cs @@ -693,20 +693,32 @@ namespace BankClientApp.Controllers case "word": APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel { - FileName = "C:\\Users\\123\\Desktop\\wordfile.docx", + FileName = "C:\\forpdf\\wordfile.docx", SelectedCardIds = cards, }); + Response.Redirect("ReportWord"); break; case "excel": APIClient.PostRequest($"api/report/savetransferstoexcel", new ReportBindingModel { - FileName = "C:\\Users\\123\\Desktop\\excelfile.xlsx", + FileName = "C:\\forpdf\\excelfile.xlsx", SelectedCardIds = cards, }); + Response.Redirect("ReportExcel"); break; default: break; } - Response.Redirect("TransferListReport"); + } + + [HttpGet] + public IActionResult ReportWord() + { + return new PhysicalFileResult("C:\\forpdf\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + } + [HttpGet] + public IActionResult ReportExcel() + { + return new PhysicalFileResult("C:\\forpdf\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); } #endregion diff --git a/Bank/BankManagersClientApp/Controllers/HomeController.cs b/Bank/BankManagersClientApp/Controllers/HomeController.cs index 812afc2..52463c8 100644 --- a/Bank/BankManagersClientApp/Controllers/HomeController.cs +++ b/Bank/BankManagersClientApp/Controllers/HomeController.cs @@ -488,20 +488,32 @@ namespace BankManagersClientApp.Controllers APIClient.PostRequest("/api/report/saverequeststoword", new ReportBindingModel { SelectedAccountIds = accounts, - FileName = "C:\\Users\\user\\Downloads\\RequestList.docx", + FileName = "C:\\forpdf\\wordfile.docx", }); + Response.Redirect("ReportWord"); break; case "excel": APIClient.PostRequest("/api/report/saverequeststoexcel", new ReportBindingModel { SelectedAccountIds = accounts, - FileName = "C:\\Users\\user\\Downloads\\RequestList.xlsx", + FileName = "C:\\forpdf\\excelfile.xlsx", }); + Response.Redirect("ReportExcel"); break; default: break; } - Response.Redirect("Index"); + } + + [HttpGet] + public IActionResult ReportWord() + { + return new PhysicalFileResult("C:\\forpdf\\wordfile.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"); + } + [HttpGet] + public IActionResult ReportExcel() + { + return new PhysicalFileResult("C:\\forpdf\\excelfile.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); } [HttpGet]