using OfficeIMO.Word; namespace OfficeIMO.Examples.Showcase.Workflows { /// Creates an editable post-incident review with a decision, supporting table and named next actions. internal static class PostIncidentReview { internal static void Create(string folder) { using var document = WordDocument.Create(Path.Combine(folder, "example.docx")); document.Settings.FontSize = global::OfficeIMO.OfficeLength.Points(11); document.Properties.Title = "Post-incident review"; document.AddParagraph("Post-incident review").Style = WordParagraphStyles.Heading1; document.AddParagraph("NORTHWIND / INCIDENT INC-042 / SYNTHETIC SCENARIO"); document.AddParagraph("A queue configuration change delayed request acknowledgements for 38 minutes. No request records were lost. The review focuses on contributing conditions and corrective work."); document.AddParagraph("What happened").Style = WordParagraphStyles.Heading2; string[][] rows = { new[] { "Time (UTC)", "Event", "Evidence", "Effect" }, new[] { "09:10", "Queue change applied", "Change log CH-014", "New acknowledgements wait" }, new[] { "09:18", "Delay alert raised", "Queue-age monitor", "Operations investigates" }, new[] { "09:36", "Previous config restored", "Recovery log", "Queue drains" }, new[] { "09:48", "Service verified", "Delivery checks", "Normal operation resumes" } }; var table = document.AddTable(rows.Length, 4, WordTableStyle.TableGrid); table.SetWidthPercentage(100); table.SetColumnWidthsPercentage(25, 20, 30, 25); for (int row = 0; row < rows.Length; row++) { for (int column = 0; column < 4; column++) { var cell = table.Rows[row].Cells[column]; cell.MarginTop = global::OfficeIMO.OfficeLength.Centimeters(0.14D); cell.MarginBottom = global::OfficeIMO.OfficeLength.Centimeters(0.14D); cell.MarginLeft = global::OfficeIMO.OfficeLength.Centimeters(0.16D); cell.MarginRight = global::OfficeIMO.OfficeLength.Centimeters(0.16D); cell.ShadingFillColor = OfficeColor.Parse(row == 0 ? "17365D" : row % 2 == 0 ? "F1F5F9" : "FFFFFF"); var paragraph = cell.Paragraphs[0]; paragraph.Text = rows[row][column]; paragraph.Bold = row == 0; paragraph.Color = OfficeColor.Parse(row == 0 ? "FFFFFF" : "243247"); paragraph.FontSize = global::OfficeIMO.OfficeLength.Points(10); paragraph.LineSpacingAfter = global::OfficeIMO.OfficeLength.Points(2D); } } document.AddParagraph("Contributing conditions").Style = WordParagraphStyles.Heading2; document.AddParagraph("The change passed a basic send check, but the test did not include a backlog. The monitor detected delay; the runbook lacked the configuration rollback step. These are sample observations, not a finding about a real system."); document.AddParagraph("Next actions").Style = WordParagraphStyles.Heading2; var actions = document.AddList(WordListStyle.Bulleted); actions.AddItem("Engineering: add a backlog case to the change check."); actions.AddItem("Operations: rehearse the documented rollback."); actions.AddItem("Service owner: verify the actions in the next review."); foreach (var paragraph in document.Paragraphs) { bool title = paragraph.Style == WordParagraphStyles.Heading1; bool heading = paragraph.Style == WordParagraphStyles.Heading2; paragraph.FontSize = global::OfficeIMO.OfficeLength.Points(title ? 26 : heading ? 15 : 11); paragraph.LineSpacingBefore = global::OfficeIMO.OfficeLength.Points(heading ? 14 : 0); paragraph.LineSpacingAfter = global::OfficeIMO.OfficeLength.Points(title ? 14 : heading ? 8 : 7); if (title || heading) { paragraph.Color = OfficeColor.Parse("17365D"); paragraph.Bold = true; paragraph.KeepWithNext = true; } } WorkflowFooter.Add(document, "Post-incident review"); document.Save(); } } }