using OfficeIMO.Pdf; namespace OfficeIMO.Examples.Showcase.Workflows { /// Creates a reviewable delivery-risk register with likelihood, impact, controls and owners. internal static class RiskAssessment { internal static void Create(string folder) { OfficeThemePalette palette = OfficeTheme.Default.Palette; OfficeColor muted = palette.TextMuted; // Status words carry the semantic colour in bold; the word itself keeps the meaning readable without colour. PdfTableCell Rating(string rating) => PdfTableCell.RichTextCell(new[] { PdfTextRun.Bolded(rating, rating switch { "High" => palette.Danger, "Medium" => palette.Warning, _ => palette.Success }) }); PdfTableCell Text(string value) => PdfTableCell.TextCell(value); PdfDocument.Create(pdf => pdf.Content(content => content .Title("Pilot delivery risk review") .AddParagraph(p => p.AddText("Northwind · Request portal · Review 03").SetFontSize(OfficeLength.Points(9)), color: muted) .AddParagraph(p => p.AddText("Use likelihood and impact to prioritise discussion, then record a specific control and an owner. The ratings are illustrative judgments.")) .H2("Open risks") .AddTable(new[] { new[] { Text("Risk"), Text("Likelihood"), Text("Impact"), Text("Control"), Text("Owner") }, new[] { Text("Queue owner unavailable"), Rating("Medium"), Rating("Medium"), Text("Name a deputy"), Text("Operations") }, new[] { Text("Pilot access incomplete"), Rating("High"), Rating("Medium"), Text("Verify accounts before day one"), Text("Platform") }, new[] { Text("Recovery untested"), Rating("Low"), Rating("High"), Text("Complete restore exercise"), Text("Engineering") }, new[] { Text("Success measure unclear"), Rating("Medium"), Rating("High"), Text("Agree baseline and metric"), Text("Product") } }) .H2("Decision before expansion") .AddPanelParagraph(p => { p.AddText("Hold the next group until access and recovery are verified.").SetBold(); p.AddText("\nThe sponsor records the acceptance decision; a low score alone is not approval."); }) .H2("Review discipline") .AddList(new[] { "Revisit ratings when evidence changes.", "Keep the control, owner and verification date together.", "Close a risk only after the control is observed." }) .AddParagraph(p => p.AddText("Fictional project example. This is not a workplace safety assessment or compliance certification.").SetFontSize(OfficeLength.Points(9)), color: muted)), new PdfCreateOptions { PageSetup = { Footer = { Show = true } } }) .Meta(title: "Pilot delivery risk review", author: "OfficeIMO").Save(Path.Combine(folder, "example.pdf")); } } }