diff --git a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj index 2702983d..3bc6cca1 100644 --- a/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj +++ b/BMA.EHR.Report.Service/BMA.EHR.Report.Service.csproj @@ -589,6 +589,18 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/BMA.EHR.Report.Service/Controllers/TransferReportController.cs b/BMA.EHR.Report.Service/Controllers/TransferReportController.cs index c458ed7b..523b4b52 100644 --- a/BMA.EHR.Report.Service/Controllers/TransferReportController.cs +++ b/BMA.EHR.Report.Service/Controllers/TransferReportController.cs @@ -60,7 +60,7 @@ namespace BMA.EHR.Report.Service.Controllers { try { - var data = await _service.GetData2Transfer(id); + //var data = await _service.GetData2Transfer(id); var mimeType = ""; switch (exportType.Trim().ToLower()) { @@ -69,27 +69,47 @@ namespace BMA.EHR.Report.Service.Controllers case "xlsx": mimeType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; break; } - var rptFile = System.IO.Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"22-หนังสือแจ้งสำนักงานการเจ้าหน้าที่-1.trdp"); + var rptFile = System.IO.Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"21-คำร้องขอโอน-1.trdp"); + var rptFile2 = System.IO.Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"21-คำร้องขอโอน-2.trdp"); + var rptFile3 = System.IO.Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"21-คำร้องขอโอน-3.trdp"); + var rptFile4 = System.IO.Path.Combine(_hostingEnvironment.ContentRootPath, "Reports", $"21-คำร้องขอโอน-4.trdp"); + ReportPackager reportPacker = new ReportPackager(); Telerik.Reporting.Report? report = null; + Telerik.Reporting.Report? report2 = null; + Telerik.Reporting.Report? report3 = null; + Telerik.Reporting.Report? report4 = null; using (var sourceStream = System.IO.File.OpenRead(rptFile)) + using (var sourceStream2 = System.IO.File.OpenRead(rptFile2)) + using (var sourceStream3 = System.IO.File.OpenRead(rptFile3)) + using (var sourceStream4 = System.IO.File.OpenRead(rptFile4)) { report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream); + report2 = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream2); + report3 = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream3); + report4 = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream4); + } - report.DataSource = data; + //report.DataSource = data; + + var reportBook = new ReportBook(); + reportBook.Reports.Add(report); + reportBook.Reports.Add(report2); + reportBook.Reports.Add(report3); + reportBook.Reports.Add(report4); System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable(); InstanceReportSource instanceReportSource = new InstanceReportSource() { - ReportDocument = report, + ReportDocument = reportBook, }; ReportProcessor reportProcessor = new ReportProcessor(_configuration); RenderingResult result = reportProcessor.RenderReport($"{exportType}", instanceReportSource, deviceInfo); var content = result.DocumentBytes; - return File(content, mimeType, $"หนังสือแจ้งสำนักงานการเจ้าหน้าที่.{exportType.Trim().ToLower()}"); + return File(content, mimeType, $"แบบคำร้องขอโอน.{exportType.Trim().ToLower()}"); } catch { diff --git a/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-1.trdp b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-1.trdp new file mode 100644 index 00000000..2463d9e6 Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-1.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-2.trdp b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-2.trdp new file mode 100644 index 00000000..f988338d Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-2.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-3.trdp b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-3.trdp new file mode 100644 index 00000000..b37bb7ee Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-3.trdp differ diff --git a/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-4.trdp b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-4.trdp new file mode 100644 index 00000000..a37d00cf Binary files /dev/null and b/BMA.EHR.Report.Service/Reports/21-คำร้องขอโอน-4.trdp differ