diff --git a/Controllers/StudyMaterial.Controller.cs b/Controllers/StudyMaterial.Controller.cs index 992791c..dfc8df0 100644 --- a/Controllers/StudyMaterial.Controller.cs +++ b/Controllers/StudyMaterial.Controller.cs @@ -17,6 +17,7 @@ namespace rmutr_report.Controllers { this._setting = setting; } + [HttpPost, Route("reports/study_material/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetMaterialReport([FromRoute] string type, @@ -25,14 +26,16 @@ namespace rmutr_report.Controllers { var workbook = new XLWorkbook(); var ws = workbook.Worksheets.Add("ง.7"); - ws.Range("A1:J1").Merge().Value = "แบบฟอร์มแผนการเรียน คณะ" + _study_material.faculty + "ปีงบประมาณ "+ _study_material.budget_year; + ws.Range("A1:J1").Merge().Value = "แบบฟอร์มแผนการเรียน คณะ" + _study_material.faculty + "ปีงบประมาณ " + + _study_material.budget_year; ws.Range("A1:J1").Style.Alignment.WrapText = true; ws.Range("A1:J1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A1:J1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("A1").Style.Font.FontSize = 16; ws.Range("A1:J1").Style.Font.Bold = true; - ws.Range("A2:J2").Merge().Value = "ผลผลิต " + _study_material.product+" คณะ "+ _study_material.faculty; + ws.Range("A2:J2").Merge().Value = + "ผลผลิต " + _study_material.product + " คณะ " + _study_material.faculty; ws.Range("A2:J2").Style.Alignment.WrapText = true; ws.Range("A2:J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A2:J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; @@ -140,92 +143,241 @@ namespace rmutr_report.Controllers var row1 = ws.Row(3); row1.Height = 20; int row = 6; - + if (_study_material != null) { - foreach (var data in _study_material.data) - { - if (data.academic_semester != "รวม") - { - ws.Cell(row, 1).Value = data.academic_semester; - ws.Cell(row, 2).Value = data.student; - ws.Cell(row, 3).Value = data.pohchang; - ws.Cell(row, 4).Value = data.bophitphimuk; - ws.Cell(row, 5).Value = data.salaya; - ws.Cell(row, 6).Value = data.klai_kangwon; - ws.Cell(row, 7).Value = data.sum_science; - ws.Cell(row, 8).Value = data.sum_social; - ws.Cell(row, 9).Value = data.cost_science; - ws.Cell(row, 10).Value = data.cost_social; + foreach (var data in _study_material.data1) + { + // ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + // XLAlignmentVerticalValues.Center; + // ws.Cell(row, 1).Style.Font.Bold = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + // XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + // row++; + ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year; + foreach (var data2 in data.data2) + { + // ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year; + ws.Cell(row, 2).Value = + "ชั้นปีที่ " + data2.year_class + " (รหัส " + data.academic_year + ")"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row, 1).Style.Font.Bold = true; + ws.Cell(row, 2).Style.Font.Bold = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + XLBorderStyleValues.Thin; + ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = - "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row, 1).Style.Font.Bold = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = - XLBorderStyleValues.Thin; - ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - - ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); - row++; - - } - if (data.academic_semester == "รวม" || data.academic_semester == "รวม 1 ปีภาคการศึกษา") + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + row++; + foreach (var data3 in data2.data3) { - - ws.Cell(row, 1).Value = data.academic_semester; - ws.Cell(row, 2).Value = data.student; - ws.Cell(row, 3).Value = data.pohchang; - ws.Cell(row, 4).Value = data.bophitphimuk; - ws.Cell(row, 5).Value = data.salaya; - ws.Cell(row, 6).Value = data.klai_kangwon; - ws.Cell(row, 7).Value = data.sum_science; - ws.Cell(row, 8).Value = data.sum_social; - ws.Cell(row, 9).Value = data.cost_science; - ws.Cell(row, 10).Value = data.cost_social; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.Bold = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = - "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = - XLAlignmentVerticalValues.Center; - ws.Cell(row, 1).Style.Font.Bold = true; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = - XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = - XLBorderStyleValues.Thin; - ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + //_study_material.text = " - สาขา "; + if (data3.academic_semester == "รวม" || + data3.academic_semester == "รวม 1 ปีภาคการศึกษา") + { + ws.Cell(row, 1).Value = data3.academic_semester; + ws.Cell(row, 2).Value = null ; + ws.Cell(row, 3).Value = data3.pohchang; + ws.Cell(row, 4).Value = data3.bophitphimuk; + ws.Cell(row, 5).Value = data3.salaya; + ws.Cell(row, 6).Value = data3.klai_kangwon; + ws.Cell(row, 7).Value = data3.sum_science; + ws.Cell(row, 8).Value = data3.sum_social; + ws.Cell(row, 9).Value = data3.cost_science; + ws.Cell(row, 10).Value = data3.cost_social; - ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); - ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); - row++; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.Bold = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + XLBorderStyleValues.Thin; + ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + //row++; + } + + if (data3.academic_semester != "รวม" && + data3.academic_semester != "รวม 1 ปีภาคการศึกษา") + { + string major = " - สาขา "; + ws.Cell(row, 1).Value = data3.academic_semester; + ws.Cell(row, 2).Value = data3.student; + ws.Cell(row, 3).Value = data3.pohchang; + ws.Cell(row, 4).Value = data3.bophitphimuk; + ws.Cell(row, 5).Value = data3.salaya; + ws.Cell(row, 6).Value = data3.klai_kangwon; + ws.Cell(row, 7).Value = data3.sum_science; + ws.Cell(row, 8).Value = data3.sum_social; + ws.Cell(row, 9).Value = data3.cost_science; + ws.Cell(row, 10).Value = data3.cost_social; + + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + "TH SarabunPSK"; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + XLAlignmentVerticalValues.Center; + ws.Cell(row, 1).Style.Font.Bold = true; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + XLBorderStyleValues.Thin; + ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + XLBorderStyleValues.Thin; + ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + //row++; + } + + row++; } - } + } + + + // if (data.academic_semester != "รวม") + // { + // ws.Cell(row, 1).Value = data.academic_semester; + // ws.Cell(row, 2).Value = data.student; + // ws.Cell(row, 3).Value = data.pohchang; + // ws.Cell(row, 4).Value = data.bophitphimuk; + // ws.Cell(row, 5).Value = data.salaya; + // ws.Cell(row, 6).Value = data.klai_kangwon; + // ws.Cell(row, 7).Value = data.sum_science; + // ws.Cell(row, 8).Value = data.sum_social; + // ws.Cell(row, 9).Value = data.cost_science; + // ws.Cell(row, 10).Value = data.cost_social; + // + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + // XLAlignmentVerticalValues.Center; + // ws.Cell(row, 1).Style.Font.Bold = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + // XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + // row++; + // + // } + // if (data.academic_semester == "รวม" || data.academic_semester == "รวม 1 ปีภาคการศึกษา") + // { + // + // ws.Cell(row, 1).Value = data.academic_semester; + // ws.Cell(row, 2).Value = data.student; + // ws.Cell(row, 3).Value = data.pohchang; + // ws.Cell(row, 4).Value = data.bophitphimuk; + // ws.Cell(row, 5).Value = data.salaya; + // ws.Cell(row, 6).Value = data.klai_kangwon; + // ws.Cell(row, 7).Value = data.sum_science; + // ws.Cell(row, 8).Value = data.sum_social; + // ws.Cell(row, 9).Value = data.cost_science; + // ws.Cell(row, 10).Value = data.cost_social; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.Bold = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical = + // XLAlignmentVerticalValues.Center; + // ws.Cell(row, 1).Style.Font.Bold = true; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder = + // XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 3).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 4).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 5).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 6).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 7).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 8).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 9).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, 10).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number); + // ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); + // row++; + // } + } } using (var stream = new MemoryStream()) diff --git a/Models/budget/study_material.cs b/Models/budget/study_material.cs index 37be7f9..4adce13 100644 --- a/Models/budget/study_material.cs +++ b/Models/budget/study_material.cs @@ -7,10 +7,29 @@ namespace rmutr_report.Models public string budget_year { get; set; } public string product { get; set; } public string faculty { get; set; } - public List data { get; set; } + public List data1 { get; set; } + //public string text { get; set; } + } - public class study_material_detail + public class study_material_detail1 + { + public string academic_semester { get; set; } + public string academic_year { get; set; } + public string year_class { get; set; } + public string code { get; set; } + public List data2 { get; set; } + + } + public class study_material_detail2 + { + public string year_class { get; set; } + public string code { get; set; } + + public List data3 { get; set; } + + } + public class study_material_detail3 { public string academic_semester { get; set; } public string student { get; set; } @@ -24,5 +43,6 @@ namespace rmutr_report.Models public decimal? sum_social { get; set; } public decimal? cost_science { get; set; } public decimal? cost_social { get; set; } + } } \ No newline at end of file