diff --git a/Controllers/KPI.Controller.cs b/Controllers/KPI.Controller.cs index 7115fd0..f1bd140 100644 --- a/Controllers/KPI.Controller.cs +++ b/Controllers/KPI.Controller.cs @@ -287,6 +287,40 @@ namespace rmutr_report.Controllers "kpi_" + date + ".xlsx"); } } - + [HttpPost, Route("reports/kpi_performance_expenditure_budget/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetKpiBudgetReport([FromRoute] string type, [FromBody] kpi_performance_expenditure_budget kpiPerformance) + { + + var kpiPerformanceExpenditure = new List() { kpiPerformance }; + + Report report = new Report(); + report.Load(_setting.report_path + "kpi_performance_expenditure_budget.frx"); + report.RegisterData(kpiPerformanceExpenditure, "kpi_performance_expenditure_budget"); + report.Prepare(); + + MemoryStream stream = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/pdf"); + + case "xls": + case "xlsx": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "kpi_performance_expenditure_budget_" + ".xlsx"); + + } + + return Ok(); + } } } \ No newline at end of file diff --git a/Models/budget/kpi_performance_expenditure_budget.cs b/Models/budget/kpi_performance_expenditure_budget.cs new file mode 100644 index 0000000..5c3965f --- /dev/null +++ b/Models/budget/kpi_performance_expenditure_budget.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class kpi_performance_expenditure_budget + { + public string budget_year { get; set; } + public string start_and_end_date_report { get; set; } + public List data_1 { get; set; } + public decimal? count_kpi_achieve { get; set; } + public decimal? count_kpi_pending { get; set; } + public decimal? percentage_1 { get; set; } + public decimal? percentage_2 { get; set; } + + } + + public class kpi_performance_expenditure_budget_detail + { + public string group_name { get; set; } + public List data_2 { get; set; } + + } + + public class kpi_performance_expenditure_budget_detail_2 + { + public string product { get; set; } + + public List data_3 { get; set; } + + } + + public class kpi_performance_expenditure_budget_detail_3 + { + public string list { get; set; } + public string unit { get; set; } + public decimal? target_value_plan { get; set; } + public decimal? target_value_result { get; set; } + public string achieve { get; set; } + public string not_achieve { get; set; } + public string director { get; set; } + public string responsible_person { get; set; } + public string compiler_reporter { get; set; } + } + +} \ No newline at end of file diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 54da702..46bd542 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.dll and b/bin/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.pdb b/bin/Debug/netcoreapp3.1/rmutr_report.pdb index acc2313..203e991 100644 Binary files a/bin/Debug/netcoreapp3.1/rmutr_report.pdb and b/bin/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 736fbb6..963f381 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -a94643e2f6cc7c9faeb2697c333a2c13987715a3 +f31ba1af0ba6d1ef2356e60b405023ff1b260a7a diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 54da702..46bd542 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.dll and b/obj/Debug/netcoreapp3.1/rmutr_report.dll differ diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.pdb b/obj/Debug/netcoreapp3.1/rmutr_report.pdb index acc2313..203e991 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/wwwroot/reports/kpi_performance_expenditure_budget.frx b/wwwroot/reports/kpi_performance_expenditure_budget.frx new file mode 100644 index 0000000..ced285c --- /dev/null +++ b/wwwroot/reports/kpi_performance_expenditure_budget.frx @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +