diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index 826afc2..1538c03 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -2169,5 +2169,42 @@ namespace rmutr_report.Controllers "revenue_estimates_" + date + ".xlsx"); } } + [HttpPost, Route("reports/summary_budget_university/{type}")] + [ApiExplorerSettings(GroupName = "reports")] + public IActionResult GetSumBudgetUniReport([FromRoute] string type, + [FromBody] summary_budget_university summary) + { + + var summaryBudget = new List() { summary}; + + Report report = new Report(); + report.Load(_setting.report_path + "summary_budget_university.frx"); + report.RegisterData(summaryBudget, "summary_budget_university"); + 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.ms-excel"); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + stream, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "summary_budget_university_"+date + ".xlsx"); + } + + return Ok(); + } } } \ No newline at end of file diff --git a/Models/budget/summary_budget_university.cs b/Models/budget/summary_budget_university.cs new file mode 100644 index 0000000..cb82744 --- /dev/null +++ b/Models/budget/summary_budget_university.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; + +namespace rmutr_report.Models +{ + public class summary_budget_university + { + public string budget_year { get; set; } + public List data { get; set; } + public decimal? total_amount_1 { get; set; } + public decimal? total_amount_2 { get; set; } + public decimal? total_amount_3 { get; set; } + public decimal? total_percentage { get; set; } + public decimal? percentage_1 { get; set; } + public decimal? percentage_2 { get; set; } + public decimal? percentage_3 { get; set; } + + + } + + public class summary_budget_university_detail + { + public string plan { get; set; } + public decimal? state_budget { get; set; } + public decimal? income_budget { get; set; } + public decimal? total_amount { get; set; } + public decimal? percentage { get; set; } + public List data_detail { get; set; } + + } + + public class summary_budget_university_detail2 + { + public string list { get; set; } + public decimal? state_budget { get; set; } + public decimal? income_budget { get; set; } + public decimal? total_amount { get; set; } + public decimal? percentage { 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 1cf88de..35de205 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 1550f61..97bdca5 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 a201456..4344303 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -6b38d80c42c7701c621aeb86361ccf2c1087d190 +3e8f480a09967665a8bdc7bd40fcb54bfc4702a6 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 1cf88de..35de205 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 1550f61..97bdca5 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/summary_budget_university.frx b/wwwroot/reports/summary_budget_university.frx new file mode 100644 index 0000000..ed5a82e --- /dev/null +++ b/wwwroot/reports/summary_budget_university.frx @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +