รายงาน กก.1 เพิ่มเครื่องราช, การลา
This commit is contained in:
parent
c7515e2a26
commit
fc449e60ad
3 changed files with 34 additions and 2 deletions
|
|
@ -485,9 +485,14 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
// Field = ""
|
// Field = ""
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
var rptFile0 = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page0.trdp");
|
||||||
|
ReportPackager reportPackager0 = new ReportPackager();
|
||||||
|
Telerik.Reporting.Report? report0 = null;
|
||||||
|
using (var sourceStream0 = System.IO.File.OpenRead(rptFile0))
|
||||||
|
{
|
||||||
|
report0 = (Telerik.Reporting.Report)reportPackager0.UnpackageDocument(sourceStream0);
|
||||||
|
}
|
||||||
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page1.trdp");
|
var rptFile = Path.Combine(_hostingEnvironment.ContentRootPath, "Report", "Profile", $"rptKK1_Page1.trdp");
|
||||||
|
|
||||||
ReportPackager reportPackager = new ReportPackager();
|
ReportPackager reportPackager = new ReportPackager();
|
||||||
Telerik.Reporting.Report? report = null;
|
Telerik.Reporting.Report? report = null;
|
||||||
using (var sourceStream = System.IO.File.OpenRead(rptFile))
|
using (var sourceStream = System.IO.File.OpenRead(rptFile))
|
||||||
|
|
@ -511,6 +516,14 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
{
|
{
|
||||||
return Error("ไม่พบข้อมูลนี้ในระบบ", 404);
|
return Error("ไม่พบข้อมูลนี้ในระบบ", 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
report0.DataSource = org.result.Profile;
|
||||||
|
var tblInsignia = (Telerik.Reporting.Table)report0.Items["detailSection1"].Items["tblInsignia"];
|
||||||
|
tblInsignia.DataSource = org.result.Insignia;
|
||||||
|
|
||||||
|
var tblLeave= (Telerik.Reporting.Table)report0.Items["detailSection1"].Items["tblLeave"];
|
||||||
|
tblLeave.DataSource = org.result.Leave; ;
|
||||||
|
|
||||||
report.DataSource = org.result.Profile;
|
report.DataSource = org.result.Profile;
|
||||||
// binding to table
|
// binding to table
|
||||||
var tblCertificate = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblCertificate"];
|
var tblCertificate = (Telerik.Reporting.Table)report.Items["detailSection1"].Items["tblCertificate"];
|
||||||
|
|
@ -541,6 +554,16 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
// catch { }
|
// catch { }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
System.Collections.Hashtable deviceInfo0 = new System.Collections.Hashtable();
|
||||||
|
InstanceReportSource instanceReportSource0 = new InstanceReportSource()
|
||||||
|
{
|
||||||
|
ReportDocument = report0
|
||||||
|
};
|
||||||
|
|
||||||
|
ReportProcessor reportProcessor0 = new ReportProcessor(_configuration);
|
||||||
|
RenderingResult result0 = reportProcessor0.RenderReport("PDF", instanceReportSource0, deviceInfo0);
|
||||||
|
var content0 = result0.DocumentBytes;
|
||||||
|
|
||||||
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
|
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
|
||||||
|
|
||||||
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
InstanceReportSource instanceReportSource = new InstanceReportSource()
|
||||||
|
|
@ -642,6 +665,15 @@ namespace BMA.EHR.Report.Service.Controllers
|
||||||
{
|
{
|
||||||
using (PdfDocument pdf = new PdfDocument(new PdfWriter(ms).SetSmartMode(true)))
|
using (PdfDocument pdf = new PdfDocument(new PdfWriter(ms).SetSmartMode(true)))
|
||||||
{
|
{
|
||||||
|
using (MemoryStream memoryStream = new MemoryStream(content0))
|
||||||
|
{
|
||||||
|
using (PdfReader reader = new PdfReader(memoryStream))
|
||||||
|
{
|
||||||
|
PdfDocument srcDoc = new PdfDocument(reader);
|
||||||
|
srcDoc.CopyPagesTo(1, srcDoc.GetNumberOfPages(), pdf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create reader from bytes
|
// Create reader from bytes
|
||||||
using (MemoryStream memoryStream = new MemoryStream(content))
|
using (MemoryStream memoryStream = new MemoryStream(content))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
BIN
Report/Profile/rptKK1_Page0.trdp
Normal file
BIN
Report/Profile/rptKK1_Page0.trdp
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue