diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index ecbbbe0..980cc91 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -3684,7 +3684,7 @@ namespace rmutr_report.Controllers 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"; @@ -3715,6 +3715,8 @@ namespace rmutr_report.Controllers 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"); + row++; foreach (var detail2 in detail.data_2) @@ -3733,7 +3735,8 @@ namespace rmutr_report.Controllers 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.Border.OutsideBorder = XLBorderStyleValues.Thin; + ws.Cell(row, 2).Style.NumberFormat.SetFormat("#,#0"); row++; } if (detail2.color=="2" && detail2.is_bold==null) @@ -3751,6 +3754,7 @@ namespace rmutr_report.Controllers 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"); row++; } if (detail2.color=="3" && detail2.is_bold==null) @@ -3768,6 +3772,7 @@ namespace rmutr_report.Controllers 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"); row++; } if (detail2.color==null && detail2.is_bold==null) @@ -3785,6 +3790,7 @@ namespace rmutr_report.Controllers // 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"); row++; } foreach (var detail3 in detail2.data_3) @@ -3804,6 +3810,7 @@ namespace rmutr_report.Controllers 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"); row++; } @@ -4126,7 +4133,7 @@ namespace rmutr_report.Controllers 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"; @@ -4157,6 +4164,7 @@ namespace rmutr_report.Controllers 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"); row++; foreach (var detail2 in detail.data_2) @@ -4173,6 +4181,7 @@ namespace rmutr_report.Controllers 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"); row++; foreach (var detail3 in detail2.data_3) @@ -4191,6 +4200,7 @@ namespace rmutr_report.Controllers 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"); row++;