diff --git a/Controllers/Graph.Controller.cs b/Controllers/Graph.Controller.cs index 558f502..7165b11 100644 --- a/Controllers/Graph.Controller.cs +++ b/Controllers/Graph.Controller.cs @@ -361,6 +361,90 @@ namespace rmutr_report.Controllers return Ok(); } + [HttpPost, Route("graph/academic_position_leave_graph/{type}")] + [ApiExplorerSettings(GroupName = "graph")] + public IActionResult GetSum9Report([FromRoute] string type, [FromBody] List graph) + { + + //var graph = new List() {reports}; + Report report = new Report(); + report.Load(_setting.report_path + "academic_position_leave_graph.frx"); + report.RegisterData(graph, "academic_position_leave_graph"); + 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": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/vnd.ms-excel"); + break; + case "mht": + MHTExport mht = new MHTExport(); + report.Export(mht, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "multipart/related"); + break; + case "csv": + CSVExport csv = new CSVExport(); + report.Export(csv, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "text/csv"); + break; + } + + return Ok(); + } + [HttpPost, Route("graph/summary_academic_position_leave_graph/{type}")] + [ApiExplorerSettings(GroupName = "graph")] + public IActionResult GetSum10Report([FromRoute] string type, [FromBody] List graph) + { + + //var graph = new List() {reports}; + Report report = new Report(); + report.Load(_setting.report_path + "summary_academic_position_leave_graph.frx"); + report.RegisterData(graph, "summary_academic_position_leave_graph"); + 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": + Excel2007Export excel = new Excel2007Export(); + report.Export(excel, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "application/vnd.ms-excel"); + break; + case "mht": + MHTExport mht = new MHTExport(); + report.Export(mht, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "multipart/related"); + break; + case "csv": + CSVExport csv = new CSVExport(); + report.Export(csv, stream); + stream.Seek(0, SeekOrigin.Begin); + return File(stream, "text/csv"); + break; + } + + return Ok(); + } // [HttpPost, Route("graph/passer_join_project_person_graph/{type}")] // [ApiExplorerSettings(GroupName = "graph")] // public IActionResult GetSum3Report([FromRoute] string type, [FromBody] List graph) diff --git a/Models/Graph/graph.cs b/Models/Graph/graph.cs index a8f1af9..3b3c72e 100644 --- a/Models/Graph/graph.cs +++ b/Models/Graph/graph.cs @@ -58,6 +58,25 @@ namespace rmutr_report.Models.Graph public int? quantity_person_return { get; set; } } + public class academic_position_leave_graph + { + public string year { get; set; } + public string position_name { get; set; } + public string faculty_name { get; set; } + public string type_increase_academic_knowledge { get; set; } + public int? quantity_person { get; set; } + } + + public class summary_academic_position_leave_graph + { + public string year { get; set; } + public string faculty_name { get; set; } + public string major_name { get; set; } + public string type_increase_academic_knowledge { get; set; } + public int? quantity_person_faculty { get; set; } + public int? quantity_person_major { get; set; } + public int? quantity_person_type_leave { get; set; } + } } // public class passer_join_project_agency_graph // { diff --git a/wwwroot/reports/academic_position_leave_graph.frx b/wwwroot/reports/academic_position_leave_graph.frx new file mode 100644 index 0000000..b00eab2 --- /dev/null +++ b/wwwroot/reports/academic_position_leave_graph.frx @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_academic_position_leave_graph.frx b/wwwroot/reports/summary_academic_position_leave_graph.frx new file mode 100644 index 0000000..db6d831 --- /dev/null +++ b/wwwroot/reports/summary_academic_position_leave_graph.frx @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +