diff --git a/Controllers/Budget.Controller.cs b/Controllers/Budget.Controller.cs index f2040fc..3cb8b74 100644 --- a/Controllers/Budget.Controller.cs +++ b/Controllers/Budget.Controller.cs @@ -411,7 +411,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontSize = 14; ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontColor = XLColor.Blue; - ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.NumberFormat.SetFormat("#,#0"); foreach (var detail in personnel.national_budget_details) { @@ -429,7 +429,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -463,7 +463,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -497,7 +497,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -529,7 +529,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -564,7 +564,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -594,28 +594,29 @@ namespace rmutr_report.Controllers report.Prepare(); MemoryStream stream = new MemoryStream(); - if (type == "pdf") + switch (type) { - - workbook.SaveAs(stream); - var content = stream.ToArray(); - stream.Position = 0; - // Set the content type and return the PDF file - return File(content, "application/pdf", "converted.pdf"); - } - - 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", - "basic_plan_" + date + ".xlsx"); + case "pdf": + { + workbook.SaveAs(stream); + var content = stream.ToArray(); + stream.Position = 0; + // Set the content type and return the PDF file + return File(content, "application/pdf", "converted.pdf"); + } + case "xlsx": + { + workbook.SaveAs(stream); + var content = stream.ToArray(); + string date = DateTime.Now.ToString("yyyyMMddHHmmss"); + return File( + content, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "basic_plan_" + date + ".xlsx"); + } + default: + return Ok(); } - - return Ok(); } [HttpPost, Route("reports/integration_strategic_plan/{type}")] @@ -797,7 +798,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(5, 2), ws.Cell(5, 11)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(5, 2), ws.Cell(5, 11)).Style.Font.FontSize = 14; ws.Range(ws.Cell(5, 2), ws.Cell(5, 11)).Style.Font.FontColor = XLColor.Blue; - ws.Range(ws.Cell(5, 2), ws.Cell(5, 11)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(5, 2), ws.Cell(5, 11)).Style.NumberFormat.SetFormat("#,#0"); foreach (var detail in personnel.integration_strategic_plan_details) { @@ -820,7 +821,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -870,7 +871,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -919,7 +920,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -968,7 +969,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 11)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 11)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -1232,7 +1233,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(5, 2), ws.Cell(5, 15)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(5, 2), ws.Cell(5, 15)).Style.Font.FontSize = 14; ws.Range(ws.Cell(5, 2), ws.Cell(5, 15)).Style.Font.FontColor = XLColor.Blue; - ws.Range(ws.Cell(5, 2), ws.Cell(5, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(5, 2), ws.Cell(5, 15)).Style.NumberFormat.SetFormat("#,#0"); foreach (var detail in personnel.integration_strategic_plan_details) { @@ -1259,7 +1260,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -1320,7 +1321,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; @@ -1381,7 +1382,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -1441,7 +1442,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; @@ -1502,7 +1503,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 15)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 15)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; diff --git a/Controllers/Personnel.Controller.cs b/Controllers/Personnel.Controller.cs index 513e84a..ef3624b 100644 --- a/Controllers/Personnel.Controller.cs +++ b/Controllers/Personnel.Controller.cs @@ -6269,7 +6269,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontName = "TH SarabunPSK"; ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontSize = 14; ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.Font.FontColor = XLColor.Blue; - ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(5, 2), ws.Cell(5, 6)).Style.NumberFormat.SetFormat("#,#0"); foreach (var detail in personnel.national_budget_details) { @@ -6287,7 +6287,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; @@ -6319,7 +6319,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; @@ -6350,7 +6350,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; @@ -6380,7 +6380,7 @@ namespace rmutr_report.Controllers ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.WrapText = true; ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Alignment.Vertical = XLAlignmentVerticalValues.Center; - ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#"); + ws.Range(ws.Cell(row, 2), ws.Cell(row, 6)).Style.NumberFormat.SetFormat("#,#0"); ws.Range(ws.Cell(row, 1), ws.Cell(row, 6)).Style.Border.OutsideBorder = XLBorderStyleValues.Thin; ws.Cell(row, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left; ws.Cell(row, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Right; diff --git a/bin/Debug/netcoreapp3.1/rmutr_report.dll b/bin/Debug/netcoreapp3.1/rmutr_report.dll index c238f5a..b752b03 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 8547568..3422951 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/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache index 164c84f..e5a17fc 100644 --- a/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache +++ b/obj/Debug/netcoreapp3.1/rmutr_report.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -f2347ed1bcc09b6148623823522308b3e2a73432 +ea26ea84899ae618caf9974b39c318714cc0cbc6 diff --git a/obj/Debug/netcoreapp3.1/rmutr_report.dll b/obj/Debug/netcoreapp3.1/rmutr_report.dll index c238f5a..b752b03 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 8547568..3422951 100644 Binary files a/obj/Debug/netcoreapp3.1/rmutr_report.pdb and b/obj/Debug/netcoreapp3.1/rmutr_report.pdb differ