diff --git a/Controllers/StudentTotalCampus.Controller.cs b/Controllers/StudentTotalCampus.Controller.cs index 79d8903..1ecb1c3 100644 --- a/Controllers/StudentTotalCampus.Controller.cs +++ b/Controllers/StudentTotalCampus.Controller.cs @@ -1,6 +1,9 @@ using System; +using System.Collections.Generic; using System.IO; using ClosedXML.Excel; +using FastReport; +using FastReport.Export.Pdf; using Microsoft.AspNetCore.Mvc; using rmutr_report.Models; using Swashbuckle.AspNetCore.Annotations; @@ -21,6 +24,125 @@ namespace rmutr_report.Controllers [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetDetailStdReport([FromRoute] string type, [FromBody] student_totalcampus _std) { + var hr1 = new List() {_std}; + foreach (var header in _std.header_data) + { + header.total1 = header.male1 + header.female1; + header.total2 = header.male2 + header.female2; + header.total3 = header.male3 + header.female3; + header.total4 = header.male4 + header.female4; + header.total5 = header.male5 + header.female5; + header.total6 = header.male6 + header.female6; + header.total7 = header.male1 + header.male2 + header.male3 + header.male4 + + header.male5 + header.male6 + + header.female1 + header.female2 + header.female3 + header.female4 + + header.female5 + header.female6; + header.room7 = header.room1 + header.room2 + header.room3 + + header.room4 + header.room5 + header.room6; + header.male7 = header.male1 + header.male2 + header.male3 + header.male4 + + header.male5 + header.male6; + header.female7 = header.female1 + header.female2 + header.female3 + header.female4 + + header.female5 + header.female6; + foreach (var data in header.data) + { + data.total1 = data.male1 + data.female1; + data.total2 = data.male2 + data.female2; + data.total3 = data.male3 + data.female3; + data.total4 = data.male4 + data.female4; + data.total5 = data.male5 + data.female5; + data.total6 = data.male6 + data.female6; + data.total7 = data.male1 + data.male2 + data.male3 + data.male4 + + data.male5 + data.male6 + + data.female1 + data.female2 + data.female3 + data.female4 + + data.female5 + data.female6; + data.room7 = data.room1 + data.room2 + data.room3 + + data.room4 + data.room5 + data.room6; + data.male7 = data.male1 + data.male2 + data.male3 + data.male4 + + data.male5 + data.male6; + data.female7 = data.female1 + data.female2 + data.female3 + data.female4 + + data.female5 + data.female6; + if (header.filter == "0") + { + data.name = null; + data.male1 = null; + data.male2 = null; + data.male3 = null; + data.male4 = null; + data.male5 = null; + data.male6 = null; + data.male7 = null; + data.female1 = null; + data.female2 = null; + data.female3 = null; + data.female4 = null; + data.female5 = null; + data.female6 = null; + data.female7 = null; + data.total1 = null; + data.total2 = null; + data.total3 = null; + data.total4 = null; + data.total5 = null; + data.total6 = null; + data.total7 = null; + data.room1 = null; + data.room2 = null; + data.room3 = null; + data.room4 = null; + data.room5 = null; + data.room6 = null; + data.room7 = null; + } + } + if (header.filter == "0") + { + header.header_name = null; + header.male1 = null; + header.male2 = null; + header.male3 = null; + header.male4 = null; + header.male5 = null; + header.male6 = null; + header.male7 = null; + header.female1 = null; + header.female2 = null; + header.female3 = null; + header.female4 = null; + header.female5 = null; + header.female6 = null; + header.female7 = null; + header.total1 = null; + header.total2 = null; + header.total3 = null; + header.total4 = null; + header.total5 = null; + header.total6 = null; + header.total7 = null; + header.room1 = null; + header.room2 = null; + header.room3 = null; + header.room4 = null; + header.room5 = null; + header.room6 = null; + header.room7 = null; + } + } + + Report report = new Report(); + report.Load(_setting.report_path + "student_total_campus.frx"); + report.RegisterData(hr1, "student_totalcampus"); + report.Prepare(); + + MemoryStream stream1 = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File(stream1, "application/pdf"); + + } var workbook = new XLWorkbook(); var ws = workbook.Worksheets.Add("student_total_campus"); ws.Range("A1:AD1").Merge().Value = "จำนวนนักศึกษาทั้งหมด ปีการศึกษา " + _std.academic_year_name_th + @@ -154,7 +276,7 @@ namespace rmutr_report.Controllers header.room6; - if (header.filter == 1) + if (header.filter == "1") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -207,7 +329,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 1.1) + if (header.filter == "1.1") { foreach (var detail in header.data) { @@ -265,7 +387,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 2) + if (header.filter == "2") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -319,7 +441,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == 3) + if (header.filter == "3") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -373,7 +495,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == 4) + if (header.filter == "4") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -426,7 +548,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 4.1) + if (header.filter == "4.1") { foreach (var detail in header.data) { @@ -486,7 +608,7 @@ namespace rmutr_report.Controllers //rowno++; } - if (header.filter == (decimal?) 4.2) + if (header.filter == "4.2") { foreach (var detail in header.data) { @@ -552,7 +674,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 5) + if (header.filter == "5") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -605,7 +727,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 5.1) + if (header.filter == "5.1") { foreach (var detail in header.data) { @@ -673,7 +795,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 6) + if (header.filter == "6") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -726,7 +848,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 3.1) + if (header.filter == "3.1") { foreach (var detail in header.data) { @@ -791,7 +913,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 0) + if (header.filter == "0") { ws.Cell(row, 1).Value = null; ws.Cell(row, 2).Value = null; diff --git a/Controllers/SummaryStudent.Controller.cs b/Controllers/SummaryStudent.Controller.cs index 1dc8b79..7be6bba 100644 --- a/Controllers/SummaryStudent.Controller.cs +++ b/Controllers/SummaryStudent.Controller.cs @@ -1,6 +1,9 @@ using System; +using System.Collections.Generic; using System.IO; using ClosedXML.Excel; +using FastReport; +using FastReport.Export.Pdf; using Microsoft.AspNetCore.Mvc; using rmutr_report.Models; using Swashbuckle.AspNetCore.Annotations; @@ -21,7 +24,129 @@ namespace rmutr_report.Controllers [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetDetailStd2Report([FromRoute] string type, [FromBody] student_totalcampus _std) { - var workbook = new XLWorkbook(); + var hr1 = new List() {_std}; + foreach (var header in _std.header_data) + { + header.total1 = header.male1 + header.female1; + header.total2 = header.male2 + header.female2; + header.total3 = header.male3 + header.female3; + header.total4 = header.male4 + header.female4; + header.total5 = header.male5 + header.female5; + header.total6 = header.male6 + header.female6; + header.total7 = header.male1 + header.male2 + header.male3 + header.male4 + + header.male5 + header.male6 + + header.female1 + header.female2 + header.female3 + header.female4 + + header.female5 + header.female6; + header.room7 = header.room1 + header.room2 + header.room3 + + header.room4 + header.room5 + header.room6; + header.male7 = header.male1 + header.male2 + header.male3 + header.male4 + + header.male5 + header.male6; + header.female7 = header.female1 + header.female2 + header.female3 + header.female4 + + header.female5 + header.female6; + foreach (var data in header.data) + { + data.total1 = data.male1 + data.female1; + data.total2 = data.male2 + data.female2; + data.total3 = data.male3 + data.female3; + data.total4 = data.male4 + data.female4; + data.total5 = data.male5 + data.female5; + data.total6 = data.male6 + data.female6; + data.total7 = data.male1 + data.male2 + data.male3 + data.male4 + + data.male5 + data.male6 + + data.female1 + data.female2 + data.female3 + data.female4 + + data.female5 + data.female6; + data.room7 = data.room1 + data.room2 + data.room3 + + data.room4 + data.room5 + data.room6; + data.male7 = data.male1 + data.male2 + data.male3 + data.male4 + + data.male5 + data.male6; + data.female7 = data.female1 + data.female2 + data.female3 + data.female4 + + data.female5 + data.female6; + if (header.filter == "0") + { + data.name = null; + data.male1 = null; + data.male2 = null; + data.male3 = null; + data.male4 = null; + data.male5 = null; + data.male6 = null; + data.male7 = null; + data.female1 = null; + data.female2 = null; + data.female3 = null; + data.female4 = null; + data.female5 = null; + data.female6 = null; + data.female7 = null; + data.total1 = null; + data.total2 = null; + data.total3 = null; + data.total4 = null; + data.total5 = null; + data.total6 = null; + data.total7 = null; + data.room1 = null; + data.room2 = null; + data.room3 = null; + data.room4 = null; + data.room5 = null; + data.room6 = null; + data.room7 = null; + } + } + if (header.filter == "0") + { + header.header_name = null; + header.male1 = null; + header.male2 = null; + header.male3 = null; + header.male4 = null; + header.male5 = null; + header.male6 = null; + header.male7 = null; + header.female1 = null; + header.female2 = null; + header.female3 = null; + header.female4 = null; + header.female5 = null; + header.female6 = null; + header.female7 = null; + header.total1 = null; + header.total2 = null; + header.total3 = null; + header.total4 = null; + header.total5 = null; + header.total6 = null; + header.total7 = null; + header.room1 = null; + header.room2 = null; + header.room3 = null; + header.room4 = null; + header.room5 = null; + header.room6 = null; + header.room7 = null; + } + } + + Report report = new Report(); + report.Load(_setting.report_path + "summary_student_total_campus.frx"); + report.RegisterData(hr1, "student_totalcampus"); + report.Prepare(); + + MemoryStream stream1 = new MemoryStream(); + switch (type) + { + case "pdf": + PDFExport pdf = new PDFExport(); + report.Export(pdf, stream1); + stream1.Seek(0, SeekOrigin.Begin); + return File(stream1, "application/pdf"); + + } + + + + var workbook = new XLWorkbook(); var ws = workbook.Worksheets.Add("student_total_campus"); ws.Range("A1:AD1").Merge().Value = "จำนวนนักศึกษาทั้งหมด ปีการศึกษา " + _std.academic_year_name_th + " ภาคการศึกษาที่ " + _std.academic_semester_name_th + @@ -145,14 +270,14 @@ namespace rmutr_report.Controllers { decimal? sum1 = header.male1 + header.female1; decimal? sum2 = header.male2 + header.female2; - decimal? sum3 = header.male3 + header.female3; - decimal? sum4 = header.male4 + header.female4; - decimal? sum5 = header.male5 + header.female5; - decimal? sum6 = header.male6 + header.female6; + decimal? sum3 = header.male3 + header.female3; + decimal? sum4 = header.male4 + header.female4; + decimal? sum5 = header.male5 + header.female5; + decimal? sum6 = header.male6 + header.female6; decimal? sumroom = header.room1 + header.room2 + header.room3 + header.room4 + header.room5 + header.room6; - if (header.filter == 1) + if (header.filter == "1") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -208,7 +333,7 @@ namespace rmutr_report.Controllers row++; } - // if (header.filter == (decimal?) 1.1) + // if (header.filter == (double?) 1.1) // { // foreach (var detail in header.data) // { @@ -260,7 +385,7 @@ namespace rmutr_report.Controllers // } // } - if (header.filter == 2) + if (header.filter == "2") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -316,7 +441,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == 3) + if (header.filter == "3") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -373,7 +498,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == 4) + if (header.filter == "4") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -427,7 +552,7 @@ namespace rmutr_report.Controllers row++; } // - // if (header.filter == (decimal?) 4.2) + // if (header.filter == (double?) 4.2) // { // foreach (var detail in header.data) // { @@ -477,7 +602,7 @@ namespace rmutr_report.Controllers // } // } - if (header.filter == 5) + if (header.filter == "5") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -533,7 +658,7 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == 6) + if (header.filter == "6") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -589,17 +714,17 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 6.1) + if (header.filter == "6.1") { foreach (var detail in header.data) { decimal? sums1 = detail.male1 + detail.female1; - decimal? sums2 = detail.male2 + detail.female2; - decimal? sums3 = detail.male3 + detail.female3; + decimal? sums2 = detail.male2 + detail.female2; + decimal? sums3 = detail.male3 + detail.female3; decimal? sums4 = detail.male4 + detail.female4; - decimal? sums5 = detail.male5 + detail.female5; + decimal? sums5 = detail.male5 + detail.female5; decimal? sums6 = detail.male6 + detail.female6; - decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + + decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + detail.room5 + detail.room6; ws.Cell(row, 1).Value = detail.name; ws.Cell(row, 2).Value = null; @@ -655,7 +780,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 7) + if (header.filter == "7") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -711,18 +836,18 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 7.1) + if (header.filter == "7.1") { foreach (var detail in header.data) { - decimal? sums1 = detail.male1 + detail.female1; + decimal? sums1 = detail.male1 + detail.female1; decimal? sums2 = detail.male2 + detail.female2; decimal? sums3 = detail.male3 + detail.female3; - decimal? sums4 = detail.male4 + detail.female4; - decimal? sums5 = detail.male5 + detail.female5; - decimal? sums6 = detail.male6 + detail.female6; - decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + - detail.room5 + detail.room6; + decimal? sums4 = detail.male4 + detail.female4; + decimal? sums5 = detail.male5 + detail.female5; + decimal? sums6 = detail.male6 + detail.female6; + decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + + detail.room5 + detail.room6; ws.Cell(row, 1).Value = detail.name; ws.Cell(row, 2).Value = null; ws.Cell(row, 3).Value = detail.male1; @@ -777,7 +902,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 8) + if (header.filter == "8") { ws.Cell(row, 1).Value = header.header_name; ws.Cell(row, 2).Value = null; @@ -831,17 +956,17 @@ namespace rmutr_report.Controllers row++; } - if (header.filter == (decimal?) 8.1) + if (header.filter == "8.1") { foreach (var detail in header.data) { decimal? sums1 = detail.male1 + detail.female1; - decimal? sums2 = detail.male2 + detail.female2; - decimal? sums3 = detail.male3 + detail.female3; - decimal? sums4 = detail.male4 + detail.female4; - decimal? sums5 = detail.male5 + detail.female5; + decimal? sums2 = detail.male2 + detail.female2; + decimal? sums3 = detail.male3 + detail.female3; + decimal? sums4 = detail.male4 + detail.female4; + decimal? sums5 = detail.male5 + detail.female5; decimal? sums6 = detail.male6 + detail.female6; - decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + + decimal? sumsroom = detail.room1 + detail.room2 + detail.room3 + detail.room4 + detail.room5 + detail.room6; ws.Cell(row, 1).Value = detail.name; ws.Cell(row, 2).Value = null; @@ -900,7 +1025,7 @@ namespace rmutr_report.Controllers } } - if (header.filter == 0) + if (header.filter == "0") { ws.Cell(row, 1).Value = null; ws.Cell(row, 2).Value = null; @@ -951,16 +1076,21 @@ namespace rmutr_report.Controllers } } - using (var stream = new MemoryStream()) + if (type == "xlsx") { - workbook.SaveAs(stream); - var content = stream.ToArray(); - string date = DateTime.Now.ToString("yyyyMMddHHmmss"); - return File( - content, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", - "sumstd" + date + ".xlsx"); + using (var stream = new MemoryStream()) + { + workbook.SaveAs(stream); + var content = stream.ToArray(); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + content, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "sumstd" + date + ".xlsx"); + } } + + return Ok(); } } } \ No newline at end of file diff --git a/Models/budget/student_total_campus.cs b/Models/budget/student_total_campus.cs index dde4d00..b68d785 100644 --- a/Models/budget/student_total_campus.cs +++ b/Models/budget/student_total_campus.cs @@ -17,69 +17,71 @@ namespace rmutr_report.Models public class student_total_campus_data { - public decimal? filter { get; set; } + public string filter { get; set; } + //public double? filter1 { get; set; } public string header_name { get; set; } public decimal? male1 { get; set; } public decimal? female1 { get; set; } - //public decimal? total1 { get; set; } + public decimal? total1 { get; set; } public decimal? room1 { get; set; } public decimal? male2 { get; set; } public decimal? female2 { get; set; } - //public decimal? total2 { get; set; } + public decimal? total2 { get; set; } public decimal? room2 { get; set; } public decimal? male3 { get; set; } public decimal? female3 { get; set; } - //public decimal? total3{ get; set; } + public decimal? total3{ get; set; } public decimal? room3 { get; set; } public decimal? male4 { get; set; } public decimal? female4 { get; set; } - // public decimal? total4 { get; set; } + public decimal? total4 { get; set; } public decimal? room4 { get; set; } public decimal? male5 { get; set; } public decimal? female5 { get; set; } - //public decimal? total5 { get; set; } + public decimal? total5 { get; set; } public decimal? room5 { get; set; } public decimal? male6 { get; set; } public decimal? female6 { get; set; } - //public decimal? total6 { get; set; } + public decimal? total6 { get; set; } public decimal? room6 { get; set; } - //public decimal? male7 { get; set; } - //public decimal? female7 { get; set; } - //public decimal? total7 { get; set; } - //public decimal? room7 { get; set; } + public decimal? male7 { get; set; } + public decimal? female7 { get; set; } + public decimal? total7 { get; set; } + public decimal? room7 { get; set; } public List data { get; set; } } public class detail { + //public decimal? row { get; set; } public string name { get; set; } public decimal? male1 { get; set; } public decimal? female1 { get; set; } - //public decimal? total1 { get; set; } + public decimal? total1 { get; set; } public decimal? room1 { get; set; } public decimal? male2 { get; set; } public decimal? female2 { get; set; } - //public decimal? total2 { get; set; } + public decimal? total2 { get; set; } public decimal? room2 { get; set; } public decimal? male3 { get; set; } public decimal? female3 { get; set; } - //public decimal? total3{ get; set; } + public decimal? total3{ get; set; } public decimal? room3 { get; set; } public decimal? male4 { get; set; } public decimal? female4 { get; set; } - //public decimal? total4 { get; set; } + public decimal? total4 { get; set; } public decimal? room4 { get; set; } public decimal? male5 { get; set; } public decimal? female5 { get; set; } - //public decimal? total5 { get; set; } + public decimal? total5 { get; set; } public decimal? room5 { get; set; } public decimal? male6 { get; set; } public decimal? female6 { get; set; } - //public decimal? total6 { get; set; } + public decimal? total6 { get; set; } public decimal? room6 { get; set; } - //public decimal? male7 { get; set; } - //public decimal? female7 { get; set; } - // public decimal? total7 { get; set; } - //public decimal? room7 { get; set; } + public decimal? male7 { get; set; } + public decimal? female7 { get; set; } + public decimal? total7 { get; set; } + public decimal? room7 { get; set; } } } \ No newline at end of file diff --git a/wwwroot/reports/student_total_campus.frx b/wwwroot/reports/student_total_campus.frx new file mode 100644 index 0000000..8213ee6 --- /dev/null +++ b/wwwroot/reports/student_total_campus.frx @@ -0,0 +1,827 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + + private void Data1_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "1" ) + Data1.FillColor = Color.Blue; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "2" ) + Data1.FillColor = Color.Yellow; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "3" ) + Data1.FillColor = Color.LightGreen; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Underline); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "4" ) + Data1.FillColor = Color.LightSteelBlue; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "5" ) + Data1.FillColor = Color.Gainsboro; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "6" ) + Data1.FillColor = Color.White; + + + } + + private void Data2_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "1.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "3.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "4.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "4.2" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "5.1" ) + Data2.FillColor = Color.White; + + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "0" ) + Data2.FillColor = Color.White; + + } + + + + + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wwwroot/reports/summary_student_total_campus.frx b/wwwroot/reports/summary_student_total_campus.frx new file mode 100644 index 0000000..a8087e3 --- /dev/null +++ b/wwwroot/reports/summary_student_total_campus.frx @@ -0,0 +1,838 @@ + + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + + private void Data1_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "1" ) + Data1.FillColor = Color.Blue; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "2" ) + Data1.FillColor = Color.Yellow; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "3" ) + Data1.FillColor = Color.White; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Underline); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "4" ) + Data1.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "5" ) + Data1.FillColor = Color.White; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "6" ) + Data1.FillColor = Color.LightGreen; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "7" ) + Data1.FillColor = Color.LightSteelBlue; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "8" ) + Data1.FillColor = Color.Gainsboro; + Cell110.Font = new Font("TH Sarabun New", 11, FontStyle.Bold); + } + + private void Data2_BeforePrint(object sender, EventArgs e) + { + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "6.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "7.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "8.1" ) + Data2.FillColor = Color.White; + if (((String)Report.GetColumnValue("student_totalcampus.header_data.filter")) == "0" ) + Data2.FillColor = Color.White; + + } + + + + + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +