diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index 4efab3a..94ab285 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -3612,7 +3612,7 @@ namespace rmutr_report.Controllers return Ok(); } - [SwaggerOperation("รวมทุกแผน")] + [SwaggerOperation("รวมทุกแผน")] [HttpPost, Route("reports/request_summary_all_plans/{type}")] [ApiExplorerSettings(GroupName = "reports")] public IActionResult GetRequestSummaryAllReport([FromRoute] string type, [FromBody] request_summary requestSummary) @@ -3982,36 +3982,36 @@ namespace rmutr_report.Controllers row++; } - if (detail2.color=="3" && detail2.is_bold==null) - { - ws.Cell(row, 1).Value = detail2.rowno + detail2.list; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; - ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); - ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell(row, 1).Style.Alignment.WrapText =true; - col2 = 2; - foreach (var budgetPlan in detail2.plans) - { - ws.Cell(row, col2).Value = budgetPlan.value??0; - ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; - ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); - ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; - ws.Cell(row, col2).Style.Font.FontSize = 10; - ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); - ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; - ws.Cell(row, col2).Style.Alignment.WrapText = true; - col2++; - - } - // col2++; - row++; - - } + // if (detail2.color=="3" && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.rowno + detail2.list; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText =true; + // col2 = 2; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // + // } + // // col2++; + // row++; + // + // } if (detail2.color==null && detail2.is_bold==null) { ws.Cell(row, 1).Value = detail2.rowno + detail2.list; @@ -4043,8 +4043,8 @@ namespace rmutr_report.Controllers } foreach (var detail3 in detail2.data_3) { - if (detail3.is_bold==true) - { + // if (detail3.is_bold==true) + // { ws.Cell(row, 1).Value = detail3.rowno+detail3.list; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row,2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -4070,7 +4070,7 @@ namespace rmutr_report.Controllers // col2++; row++; - } + //} } } @@ -4090,6 +4090,484 @@ namespace rmutr_report.Controllers "all_plans" + ".xlsx"); } } + // [SwaggerOperation("รวมทุกแผน")] + // [HttpPost, Route("reports/request_summary_all_plans/{type}")] + // [ApiExplorerSettings(GroupName = "reports")] + // public IActionResult GetRequestSummaryAllReport([FromRoute] string type, [FromBody] request_summary requestSummary) + // { + // var workbook = new XLWorkbook(); + // var ws = workbook.Worksheets.Add("Sheet1"); + // //ws.Columns("A").AdjustToContents(); + // ws.Column(1).Width = 45; + // ws.Column(2).Width = 20; + // ws.Column(3).Width = 20; + // ws.Column(4).Width = 20; + // ws.Column(5).Width = 20; + // ws.Column(6).Width = 20; + // ws.Column(8).Width = 20; + // ws.Column(9).Width = 20; + // ws.Column(10).Width = 20; + // ws.Column(11).Width = 20; + // ws.Column(12).Width = 20; + // + // + // ws.Cell("A1").Value = "งบประมาณแผ่นดิน ปีงบประมาณ พ.ศ. "+requestSummary.budget_year+" (คำขอ)"; + // ws.Cell("A1").Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell("A1").Style.Font.FontSize = 10; + // ws.Cell("A2").Value = "มหาวิทยาลัยเทคโนโลยีราชมงคลรัตนโกสินทร์"; + // ws.Cell("A2").Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell("A2").Style.Font.FontSize = 10; + // + // int col = 2; + // int cols = 2; + // int rowheads = 3; + // int rowhead = 4; + // int rowvalue = 5; + // int row = 6; + // + // int rowno = 1; + // + // if (requestSummary != null) + // { + // var countbudgetplan = requestSummary.plans.Count; + // if (countbudgetplan==1) + // { + // foreach (var i in requestSummary.plans) + // { + // ws.Range("A3:A5").Merge().Value = "งบรายจ่าย"; + // ws.Cell(3, 2).Value = "งบประมาณ " + requestSummary.budget_year + " (คำขอ)"; + // ws.Cell(4, 2).Value = i.budget_plan_name; + // ws.Cell(5, 2).Value = i.value??0; + // ws.Cell(4, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(4, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(4, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(4, 2).Style.Border.RightBorder = XLBorderStyleValues.Thin; + // ws.Cell(4, 2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(4, 2).Style.Font.FontSize = 10; + // ws.Cell(4, 2).Style.Alignment.WrapText = true; + // ws.Cell("A3").Style.Alignment.WrapText = true; + // ws.Cell("A3").Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell("A3").Style.Font.FontSize = 10; + // ws.Range("A3:A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range("A3:A5").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Range("A3:A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range("A3:A5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(3, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(3, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Cell(3, 2).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell(3, 2).Style.Font.FontSize = 10; + // ws.Cell(3, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(3, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(3, 2).Style.Alignment.WrapText = true; + // ws.Cell(4, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(4, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Cell(4, 2).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell(4, 2).Style.Font.FontSize = 10; + // ws.Cell(4, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // + // ws.Cell(5, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(5, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(5, 2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Cell(5, 2).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell(5, 2).Style.Font.FontSize = 10; + // ws.Cell(5, 2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(5, 2).Style.Alignment.WrapText = true; + // } + // + // foreach (var detail in requestSummary.data_1) + // { + // + // ws.Cell(row, 1).Value = detail.rowno + detail.list; + // foreach (var budgetPlan in detail.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(5, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Alignment.Vertical = + // XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Font.SetBold().Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Fill.BackgroundColor = + // XLColor.FromArgb(204, 153, 255); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // + // foreach (var detail2 in detail.data_2) + // { + // if (detail2.color=="1" && detail2.is_bold==true) + // { + // ws.Cell(row, 1).Value = detail2.list; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(153, 204, 255); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // } + // if (detail2.color=="2" && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.list; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor =XLColor.FromArgb(255, 204, 153); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // } + // if (detail2.color=="3" && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.rowno + detail2.list; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // } + // if (detail2.color==null && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.rowno + detail2.list; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 204, 153); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // } + // foreach (var detail3 in detail2.data_3) + // { + // if (detail3.is_bold==true) + // { + // ws.Cell(row, 1).Value = detail3.rowno+detail3.list; + // foreach (var budgetPlan in detail3.plans) + // { + // ws.Cell(row, 2).Value = budgetPlan.value??0; + // } + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row,2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // row++; + // } + // + // } + // } + // + // } + // + // + // } + // + // if (countbudgetplan>1) + // { + // foreach (var i in requestSummary.plans) + // { + // + // ws.Range("A3:A5").Merge().Value = "งบรายจ่าย"; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Merge().Value = "งบประมาณ " + requestSummary.budget_year + " (คำขอ)"; + // ws.Cell(rowhead, col).Value = i.budget_plan_name; + // ws.Cell(rowvalue, col).Value = i.value??0; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style + // .Border + // .OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Range(ws.Cell(rowheads, cols), ws.Cell(rowheads , cols+ countbudgetplan - 1)).Style.Alignment.WrapText = true; + // + // ws.Cell(rowhead, col).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(rowhead, col).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(rowhead, col).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(rowhead, col).Style.Border.RightBorder = XLBorderStyleValues.Thin; + // ws.Cell(rowhead, col).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(rowhead, col).Style.Font.FontSize = 10; + // ws.Cell(rowhead, col).Style.Alignment.WrapText = true; + // ws.Cell(rowhead, col).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Range("A3:A5").Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell("A3").Style.Alignment.WrapText = true; + // ws.Cell("A3").Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell("A3").Style.Font.FontSize = 10; + // ws.Range("A3:A5").Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range("A3:A5").Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Range("A3:A5").Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(rowvalue, col).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(rowvalue, col).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 153, 204); + // ws.Cell(rowvalue, col).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Cell(rowvalue, col).Style.Font.FontSize = 10; + // ws.Cell(rowvalue, col).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(rowvalue, col).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(rowvalue, col).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(rowvalue, col).Style.Alignment.WrapText = true; + // ws.Cell(rowheads, col).Style.Alignment.WrapText = true; + // col++; + // } + // + // foreach (var detail in requestSummary.data_1) + // { + // int col2 = 2; + // ws.Cell(row, 1).Value = detail.rowno + detail.list; + // // int col2 = 2; + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Alignment.Vertical = + // XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Border.OutsideBorder = + // XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Font.SetBold().Font.FontName = + // "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1), ws.Cell(row, 2)).Style.Fill.BackgroundColor = + // XLColor.FromArgb(204, 153, 255); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // ws.Cell(row, 2).Style.Alignment.WrapText = true; + // foreach (var budgetPlan in detail.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(204, 153, 255); + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.SetBold().Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, cols).Style.Alignment.WrapText = true; + // + // col2++; + // } + // row++; + // + // foreach (var detail2 in detail.data_2) + // { + // if (detail2.color=="1" && detail2.is_bold==true) + // { + // ws.Cell(row, 1).Value = detail2.list; + // + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(153, 204, 255); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // + // col2 = 2; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(153, 204, 255); + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.SetBold().Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // } + // // col2++; + // row++; + // + // } + // if (detail2.color=="2" && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.list; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor =XLColor.FromArgb(255, 204, 153); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // col2 = 2; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 204, 153); + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // + // } + // //col2++; + // row++; + // + // } + // if (detail2.color=="3" && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.rowno + detail2.list; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText =true; + // col2 = 2; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Fill.BackgroundColor = XLColor.FromArgb(255, 255, 204); + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // + // } + // // col2++; + // row++; + // + // } + // if (detail2.color==null && detail2.is_bold==null) + // { + // ws.Cell(row, 1).Value = detail2.rowno + detail2.list; + // + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row,2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // col2 = 2; + // foreach (var budgetPlan in detail2.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // + // } + // //col2++; + // row++; + // + // } + // foreach (var detail3 in detail2.data_3) + // { + // if (detail3.is_bold==true) + // { + // ws.Cell(row, 1).Value = detail3.rowno+detail3.list; + // ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; + // ws.Cell(row,2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.SetBold().Font.FontName = "TH SarabunPSK"; + // ws.Range(ws.Cell(row, 1),ws.Cell(row,2)).Style.Font.FontSize = 10; + // ws.Cell(row, 1).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, 1).Style.Alignment.WrapText = true; + // col2 = 2; + // foreach (var budgetPlan in detail3.plans) + // { + // ws.Cell(row, col2).Value = budgetPlan.value??0; + // ws.Cell(row, col2).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; + // ws.Cell(row, col2).Style.Font.FontName = "TH SarabunPSK"; + // ws.Cell(row, col2).Style.Font.SetBold().Font.FontSize = 10; + // ws.Cell(row, col2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; + // ws.Cell(row, col2).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; + // ws.Cell(row, col2).Style.NumberFormat.SetFormat("#,#0"); + // ws.Cell(row, col2).Style.Alignment.WrapText = true; + // col2++; + // } + // // col2++; + // row++; + // + // } + // + // } + // } + // + // } + // + // + // } + // } + // using (var stream = new MemoryStream()) + // { + // workbook.SaveAs(stream); + // var content = stream.ToArray(); + // return File( + // content, + // "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + // "all_plans" + ".xlsx"); + // } + // } [SwaggerOperation("แผนบูรณาการแผนยุทธศาสตร์")] [HttpPost, Route("reports/request_summary_integrated_strategic/{type}")] [ApiExplorerSettings(GroupName = "reports")] diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index 54a534f..c50b517 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 90ea925..a1cf19a 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/net5.0/rmutr_report.AssemblyInfo.cs b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs index dbabf2d..aa21837 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ed25cb4cc4338406762b8b41ec048f3b8627e59a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b009389dc0708df31994b749d03145a84b87e6a7")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache index f510589..4b09d69 100644 --- a/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/net5.0/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -4f8db49c5fe9cbeb4f268f15183abfdc9fb013473e8ffec5aacf1e7f8894c7f7 +f6b8428931236a455056fe3f165c6926bfa81e848064c3251c7fa774e28e0711 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs index dbabf2d..aa21837 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ed25cb4cc4338406762b8b41ec048f3b8627e59a")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b009389dc0708df31994b749d03145a84b87e6a7")] [assembly: System.Reflection.AssemblyProductAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyTitleAttribute("rmutr_report")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache index f510589..4b09d69 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.AssemblyInfoInputs.cache @@ -1 +1 @@ -4f8db49c5fe9cbeb4f268f15183abfdc9fb013473e8ffec5aacf1e7f8894c7f7 +f6b8428931236a455056fe3f165c6926bfa81e848064c3251c7fa774e28e0711 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache index 834ebb3..38b1c25 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.RazorTargetAssemblyInfo.cache @@ -1 +1 @@ -c3ec5bedeeb20c8d9c3c9cd85eba76decb15760ad1bf37e9a672754976963d6e +2963e75e73c9d759e5d3ddf70c79ac6534fb3b9993a70ed5c2f91b1717463bbd diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index 54a534f..c50b517 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 90ea925..a1cf19a 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ diff --git a/obj/rider.project.model.nuget.info b/obj/rider.project.model.nuget.info index 49bc6e6..2778ea5 100644 --- a/obj/rider.project.model.nuget.info +++ b/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17254270391808934 \ No newline at end of file +17254282354108198 \ No newline at end of file diff --git a/obj/rider.project.restore.info b/obj/rider.project.restore.info index 2778ea5..51997b4 100644 --- a/obj/rider.project.restore.info +++ b/obj/rider.project.restore.info @@ -1 +1 @@ -17254282354108198 \ No newline at end of file +17254343416267455 \ No newline at end of file