parent
4494939c5f
commit
0dcabaa25d
1 changed files with 16 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Routing.Template;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using OfficeOpenXml;
|
using OfficeOpenXml;
|
||||||
|
using OfficeOpenXml.Style;
|
||||||
using Swashbuckle.AspNetCore.Annotations;
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
|
|
@ -2227,6 +2228,21 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||||
range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||||
range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
|
||||||
|
range.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Top;
|
||||||
|
|
||||||
|
// Center Align: คอลัมน์ 1 (A), 3 (C), 4 (D), 6 (F), 7 (G), 9 (I)
|
||||||
|
var centerColumns = new[] { 1, 3, 4, 6, 7, 9 };
|
||||||
|
foreach (var col in centerColumns)
|
||||||
|
{
|
||||||
|
worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Left Align: คอลัมน์ 2 (B), 5 (E), 8 (H), 10 (J)
|
||||||
|
var leftColumns = new[] { 2, 5, 8, 10 };
|
||||||
|
foreach (var col in leftColumns)
|
||||||
|
{
|
||||||
|
worksheet.Cells[startRow, col, startRow + totalRows - 1, col].Style.HorizontalAlignment = ExcelHorizontalAlignment.Left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ส่วนสรุปท้ายตาราง
|
// ส่วนสรุปท้ายตาราง
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue