From bd51bb4d264e9c810427392f2a499ba98252897a Mon Sep 17 00:00:00 2001 From: SmartRootsSrl Date: Mon, 23 Mar 2026 17:05:39 +0100 Subject: [PATCH] fix: Italian labels + section title style + double header row height in dividend renderer --- .../DividendSectionRenderer.cs | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/CertReports.Syncfusion/Services/Implementations/DividendSectionRenderer.cs b/CertReports.Syncfusion/Services/Implementations/DividendSectionRenderer.cs index 1312c5a..30225a4 100644 --- a/CertReports.Syncfusion/Services/Implementations/DividendSectionRenderer.cs +++ b/CertReports.Syncfusion/Services/Implementations/DividendSectionRenderer.cs @@ -35,9 +35,21 @@ public class DividendSectionRenderer private static readonly string[] Col2Headers = [ - "", "Strike", "Last", "% Perf.", - "Barr.Cap.", "Buf.Cap.", "Trig.CPN", "Buf.CPN", "Trig.AC", - "Data Stacco", "Data Pag.", "Importo", "Rend.", "Imp.Fut.", "Rend.Fut.", + "", // Nome (nessuna sub-label) + "Livello Iniziale", // Strike + "Ultimo Prezzo", // Last + "% Perf.", // % Perf. (invariato) + "Barriera Capitale", // Barr.Cap. + "Protezione Capitale", // Buf.Cap. + "Livello Cedola", // Trig.CPN + "Protezione Cedola", // Buf.CPN + "Livello Richiamo Anticipato", // Trig.AC + "Data Stacco", // (invariato) + "Data Pagamento", // Data Pag. + "Importo", // (invariato) + "Rendimento", // Rend. + "Importo Futuro", // Imp.Fut. + "Rendimento Futuro", // Rend.Fut. ]; // Indici colonne soggette a colore performance (0-based) @@ -65,14 +77,12 @@ public class DividendSectionRenderer float x0 = PdfTheme.PageMargin; float y = PdfTheme.PageMargin; - // ── Titolo ──────────────────────────────────────────────────── - g.DrawString("Sottostanti e Dividendi", PdfTheme.Title, PdfTheme.AccentBlueBrush, - new RectangleF(x0, y, w, 20f)); - y += 20f + 4f; - - // ── Linea separatrice ───────────────────────────────────────── - g.DrawLine(PdfTheme.AccentBluePen, new PointF(x0, y), new PointF(x0 + w, y)); - y += 6f; + // ── Titolo stile DrawSectionLabel ───────────────────────────── + float rh0 = PdfTheme.RowHeight; + g.DrawRectangle(PdfTheme.TableHeaderBrush, new RectangleF(x0, y, w, rh0)); + g.DrawString("Sottostanti e Dividendi", PdfTheme.TableBold, PdfBrushes.White, + new RectangleF(x0 + 4f, y + 2f, w - 8f, rh0)); + y += rh0 + 4f; // ── Calcolo fattore scala su larghezza reale ────────────────── float totalNominal = ColWidths.Sum(); @@ -84,7 +94,7 @@ public class DividendSectionRenderer DrawHeader(g, x0, y, cw, rh); - y += rh * 2; + y += rh * 3; // ── Tabella dati ────────────────────────────────────────────── DrawDataGrid(g, data, x0, y, cw); @@ -127,13 +137,13 @@ public class DividendSectionRenderer for (int i = 0; i < cw.Length; i++) { var bg = i >= 9 ? DarkBlueBrush : accentBrush; - DrawHeaderCell(g, cx, y + rh, cw[i], rh, Col2Headers[i], bg, whiteBrush, headerFont); + DrawHeaderCell(g, cx, y + rh, cw[i], rh * 2, Col2Headers[i], bg, whiteBrush, headerFont); cx += cw[i]; } // ── Separatore verticale tra col 8 e col 9 ──────────────────── float sepX = x0 + cw.Take(9).Sum(); - g.DrawLine(SeparatorPen, new PointF(sepX, y), new PointF(sepX, y + rh * 2)); + g.DrawLine(SeparatorPen, new PointF(sepX, y), new PointF(sepX, y + rh * 3)); } private static void DrawHeaderCell(PdfGraphics g, float x, float y, float w, float h,