ปรับ padding

This commit is contained in:
harid 2025-11-14 21:25:11 +07:00
parent db98f8f6d6
commit 93db5c982a
2 changed files with 35 additions and 31 deletions

View file

@ -738,6 +738,7 @@ namespace BMA.EHR.Report.Service.Controllers
// Title
var title = new Paragraph($"รายชื่อผู้มีสิทธิ์สอบ\n{examName ?? ""}")
.SetBold()
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(title);
@ -747,10 +748,9 @@ namespace BMA.EHR.Report.Service.Controllers
{
// Group Header (ตำแหน่ง)
Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}")
.SetTextAlignment(TextAlignment.CENTER)
.SetBold()
.SetFontSize(15)
.SetMarginBottom(10);
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(positionHeader);
@ -761,19 +761,20 @@ namespace BMA.EHR.Report.Service.Controllers
string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" };
foreach (var h in headers)
{
table.AddHeaderCell(new Cell().Add(new Paragraph(h)).SetTextAlignment(TextAlignment.CENTER).SetBold());
table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f))
.SetBold()
.SetTextAlignment(TextAlignment.CENTER));
}
// Table Details
foreach (var x in group.Persons)
{
table.AddCell(new Cell().Add(new Paragraph(x.No)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.ExamId)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.FullName)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "")).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
}
document.Add(table);
// เว้นระหว่าง groups
document.Add(new Paragraph("\n"));
}
}
@ -864,6 +865,7 @@ namespace BMA.EHR.Report.Service.Controllers
var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}")
.SetBold()
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(title);
@ -872,10 +874,10 @@ namespace BMA.EHR.Report.Service.Controllers
{
// Header per group
Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}")
.SetTextAlignment(TextAlignment.CENTER)
.SetBold()
.SetFontSize(15)
.SetMarginBottom(10);
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(positionHeader);
@ -885,17 +887,17 @@ namespace BMA.EHR.Report.Service.Controllers
string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" };
foreach (var h in headers)
{
table.AddHeaderCell(new Cell().Add(new Paragraph(h))
table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f))
.SetTextAlignment(TextAlignment.CENTER)
.SetBold());
}
foreach (var p in g.Persons)
{
table.AddCell(new Cell().Add(new Paragraph(p.Number)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell());
table.AddCell(new Cell().Add(new Paragraph(p.FullName)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(p.SumScore)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
}
document.Add(table);

View file

@ -406,6 +406,7 @@ namespace BMA.EHR.Report.Service.Controllers
$"รายชื่อผู้ชำระค่าธรรมเนียมการสมัครสอบการแข่งขันเพื่อบรรจุและแต่งตั้งบุคคลเข้ารับราชการเป็นข้าราชการกรุงเทพมหานครสามัญ {examName ?? ""}"
)
.SetBold()
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(title);
@ -415,10 +416,9 @@ namespace BMA.EHR.Report.Service.Controllers
{
// Group Header (ตำแหน่ง)
Paragraph positionHeader = new Paragraph($"{group.PositionName} {group.Total}")
.SetTextAlignment(TextAlignment.CENTER)
.SetBold()
.SetFontSize(15)
.SetMarginBottom(10);
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER);
document.Add(positionHeader);
@ -429,16 +429,18 @@ namespace BMA.EHR.Report.Service.Controllers
string[] headers = { "ลำดับที่", "เลขประจำตัวสอบ", "ชื่อ-สกุล", "หมายเหตุ" };
foreach (var h in headers)
{
table.AddHeaderCell(new Cell().Add(new Paragraph(h)).SetTextAlignment(TextAlignment.CENTER).SetBold());
table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f))
.SetBold()
.SetTextAlignment(TextAlignment.CENTER));
}
// Table Details
foreach (var x in group.Persons)
{
table.AddCell(new Cell().Add(new Paragraph(x.No)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.ExamId)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.FullName)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "")).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.No).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.ExamId).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(x.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(x.Remark ?? "").SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
}
document.Add(table);
// เว้นระหว่าง groups
@ -605,6 +607,7 @@ namespace BMA.EHR.Report.Service.Controllers
document.SetMargins(30, 15, 20, 15);
var title = new Paragraph($"รายชื่อผู้สอบแข่งขันได้\n{examName}")
.SetMultipliedLeading(0.9f)
.SetBold()
.SetTextAlignment(TextAlignment.CENTER);
@ -614,10 +617,9 @@ namespace BMA.EHR.Report.Service.Controllers
{
// Header per group
Paragraph positionHeader = new Paragraph($"{g.PositionName} {g.Total}")
.SetMultipliedLeading(0.9f)
.SetTextAlignment(TextAlignment.CENTER)
.SetBold()
.SetFontSize(15)
.SetMarginBottom(10);
.SetBold();
document.Add(positionHeader);
@ -627,17 +629,17 @@ namespace BMA.EHR.Report.Service.Controllers
string[] headers = { "ลำดับที่", "สนามสอบ", "ชื่อ - นามสกุล", "คะแนนสอบ" };
foreach (var h in headers)
{
table.AddHeaderCell(new Cell().Add(new Paragraph(h))
table.AddHeaderCell(new Cell().Add(new Paragraph(h).SetMultipliedLeading(0.9f))
.SetTextAlignment(TextAlignment.CENTER)
.SetBold());
}
foreach (var p in g.Persons)
{
table.AddCell(new Cell().Add(new Paragraph(p.Number)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(p.Number).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell());
table.AddCell(new Cell().Add(new Paragraph(p.FullName)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(p.SumScore)).SetTextAlignment(TextAlignment.CENTER));
table.AddCell(new Cell().Add(new Paragraph(p.FullName).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.LEFT));
table.AddCell(new Cell().Add(new Paragraph(p.SumScore).SetMultipliedLeading(0.9f)).SetTextAlignment(TextAlignment.CENTER));
}
document.Add(table);