From ae8e7c6e429fb271bd58244d01e8ca7f0ba49b78 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 9 Nov 2026 12:46:15 -0500 Subject: [PATCH] feat(report): lay the summary header out in two key/value columns The one-column list took nine rows before the Plates table, pushing part cards onto later pages. Job and material now sit on the left and the report's totals on the right, five rows at most. Co-Authored-By: Claude Opus 5.5 --- OpenNest.Reporting/NestPdfWriter.cs | 36 ++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/OpenNest.Reporting/NestPdfWriter.cs b/OpenNest.Reporting/NestPdfWriter.cs index e6b01a0a..32f8161a 100644 --- a/OpenNest.Reporting/NestPdfWriter.cs +++ b/OpenNest.Reporting/NestPdfWriter.cs @@ -109,19 +109,33 @@ public static class NestPdfWriter title.Format.Font.Bold = true; title.Format.SpaceAfter = Unit.FromPoint(6); - var info = AddTable(section, 130, 410); - info.Borders.Visible = false; - AddInfoRow(info, "Nest:", snapshot.Name); + // Two key/value columns keep the header short so more part cards fit on the first page: + // the job and material on the left, the report's totals on the right. + var left = new List<(string Key, string Value)> { ("Nest:", snapshot.Name) }; if (snapshot.Customer.Length > 0) - AddInfoRow(info, "Customer:", snapshot.Customer); - AddInfoRow(info, "Material:", Material(snapshot)); - AddInfoRow(info, "Thickness:", Thickness(snapshot)); - AddInfoRow(info, "Units:", snapshot.Units == "mm" ? "millimeters (mm)" : "inches (in)"); - AddInfoRow(info, "Generated:", snapshot.GeneratedAt.ToString("yyyy-MM-dd HH:mm zzz", Invariant)); - AddInfoRow(info, "Distinct layouts:", snapshot.Plates.Length.ToString(Invariant)); - AddInfoRow(info, "Total physical sheets:", snapshot.TotalSheets.ToString(Invariant)); + left.Add(("Customer:", snapshot.Customer)); + left.Add(("Material:", Material(snapshot))); + left.Add(("Thickness:", Thickness(snapshot))); + left.Add(("Units:", snapshot.Units == "mm" ? "millimeters (mm)" : "inches (in)")); + var right = new List<(string Key, string Value)> + { + ("Generated:", snapshot.GeneratedAt.ToString("yyyy-MM-dd HH:mm zzz", Invariant)), + ("Distinct layouts:", snapshot.Plates.Length.ToString(Invariant)), + ("Total physical sheets:", snapshot.TotalSheets.ToString(Invariant)), + }; if (snapshot.TotalCutTime is { } total) - AddInfoRow(info, "Estimated cut time:", Duration(total) + " (all sheets)"); + right.Add(("Estimated cut time:", Duration(total) + " (all sheets)")); + + var info = AddTable(section, 72, 182, 136, 150); + info.Borders.Visible = false; + // The left column always has at least as many rows as the right. + for (var index = 0; index < left.Count; index++) + { + string[] cells = index < right.Count + ? [left[index].Key, left[index].Value, right[index].Key, right[index].Value] + : [left[index].Key, left[index].Value]; + AddInfoRow(info, cells); + } if (snapshot.Notes.Length > 0) { // Free paragraphs split across pages; a table row taller than a page would be clipped.