bug fixed

This commit is contained in:
kamonwan taengsuk
2023-03-24 17:37:34 +07:00
parent 5c053f8fd5
commit 379fc76fac
2 changed files with 256 additions and 84 deletions

View File

@@ -17,6 +17,7 @@ namespace rmutr_report.Controllers
{ {
this._setting = setting; this._setting = setting;
} }
[HttpPost, Route("reports/study_material/{type}")] [HttpPost, Route("reports/study_material/{type}")]
[ApiExplorerSettings(GroupName = "reports")] [ApiExplorerSettings(GroupName = "reports")]
public IActionResult GetMaterialReport([FromRoute] string type, public IActionResult GetMaterialReport([FromRoute] string type,
@@ -25,14 +26,16 @@ namespace rmutr_report.Controllers
{ {
var workbook = new XLWorkbook(); var workbook = new XLWorkbook();
var ws = workbook.Worksheets.Add("ง.7"); 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.WrapText = true;
ws.Range("A1:J1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A1:J1").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A1:J1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("A1:J1").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK"; ws.Cell("A1").Style.Font.FontName = "TH SarabunPSK";
ws.Cell("A1").Style.Font.FontSize = 16; ws.Cell("A1").Style.Font.FontSize = 16;
ws.Range("A1:J1").Style.Font.Bold = true; 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.WrapText = true;
ws.Range("A2:J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Range("A2:J2").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
ws.Range("A2:J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; ws.Range("A2:J2").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center;
@@ -140,92 +143,241 @@ namespace rmutr_report.Controllers
var row1 = ws.Row(3); var row1 = ws.Row(3);
row1.Height = 20; row1.Height = 20;
int row = 6; int row = 6;
if (_study_material != null) if (_study_material != null)
{ {
foreach (var data in _study_material.data) foreach (var data in _study_material.data1)
{ {
if (data.academic_semester != "รวม") // ws.Cell(row, 1).Value = "ภาคการศึกษา " + data.academic_semester + "/" + data.academic_year;
{ // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName =
ws.Cell(row, 1).Value = data.academic_semester; // "TH SarabunPSK";
ws.Cell(row, 2).Value = data.student; // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16;
ws.Cell(row, 3).Value = data.pohchang; // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true;
ws.Cell(row, 4).Value = data.bophitphimuk; // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.Vertical =
ws.Cell(row, 5).Value = data.salaya; // XLAlignmentVerticalValues.Center;
ws.Cell(row, 6).Value = data.klai_kangwon; // ws.Cell(row, 1).Style.Font.Bold = true;
ws.Cell(row, 7).Value = data.sum_science; // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.OutsideBorder =
ws.Cell(row, 8).Value = data.sum_social; // XLBorderStyleValues.Thin;
ws.Cell(row, 9).Value = data.cost_science; // ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Border.RightBorder =
ws.Cell(row, 10).Value = data.cost_social; // 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 = ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).SetDataType(XLDataType.Number);
"TH SarabunPSK"; ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#");
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontSize = 16; row++;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Alignment.WrapText = true; foreach (var data3 in data2.data3)
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 ปีภาคการศึกษา")
{ {
//_study_material.text = " - สาขา ";
ws.Cell(row, 1).Value = data.academic_semester; if (data3.academic_semester == "รวม" ||
ws.Cell(row, 2).Value = data.student; data3.academic_semester == "รวม 1 ปีภาคการศึกษา")
ws.Cell(row, 3).Value = data.pohchang; {
ws.Cell(row, 4).Value = data.bophitphimuk; ws.Cell(row, 1).Value = data3.academic_semester;
ws.Cell(row, 5).Value = data.salaya; ws.Cell(row, 2).Value = null ;
ws.Cell(row, 6).Value = data.klai_kangwon; ws.Cell(row, 3).Value = data3.pohchang;
ws.Cell(row, 7).Value = data.sum_science; ws.Cell(row, 4).Value = data3.bophitphimuk;
ws.Cell(row, 8).Value = data.sum_social; ws.Cell(row, 5).Value = data3.salaya;
ws.Cell(row, 9).Value = data.cost_science; ws.Cell(row, 6).Value = data3.klai_kangwon;
ws.Cell(row, 10).Value = data.cost_social; ws.Cell(row, 7).Value = data3.sum_science;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.Bold = true; ws.Cell(row, 8).Value = data3.sum_social;
ws.Range(ws.Cell(row, 1), ws.Cell(row, 10)).Style.Font.FontName = ws.Cell(row, 9).Value = data3.cost_science;
"TH SarabunPSK"; ws.Cell(row, 10).Value = data3.cost_social;
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, 1), ws.Cell(row, 10)).Style.Font.FontName =
ws.Range(ws.Cell(row, 3), ws.Cell(row, 10)).Style.NumberFormat.SetFormat("#,#"); "TH SarabunPSK";
row++; 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()) using (var stream = new MemoryStream())

View File

@@ -7,10 +7,29 @@ namespace rmutr_report.Models
public string budget_year { get; set; } public string budget_year { get; set; }
public string product { get; set; } public string product { get; set; }
public string faculty { get; set; } public string faculty { get; set; }
public List<study_material_detail> data { get; set; } public List<study_material_detail1> 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<study_material_detail2> data2 { get; set; }
}
public class study_material_detail2
{
public string year_class { get; set; }
public string code { get; set; }
public List<study_material_detail3> data3 { get; set; }
}
public class study_material_detail3
{ {
public string academic_semester { get; set; } public string academic_semester { get; set; }
public string student { get; set; } public string student { get; set; }
@@ -24,5 +43,6 @@ namespace rmutr_report.Models
public decimal? sum_social { get; set; } public decimal? sum_social { get; set; }
public decimal? cost_science { get; set; } public decimal? cost_science { get; set; }
public decimal? cost_social { get; set; } public decimal? cost_social { get; set; }
} }
} }