From 5a4ad30aed8871832885526fcb0eaf049540384d Mon Sep 17 00:00:00 2001
From: lx <ex_lixiang17@cosl.com.cn>
Date: 星期二, 05 八月 2025 10:51:32 +0800
Subject: [PATCH] report high light
---
ErrorAnalysis.Service/WordReportHelper.cs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ErrorAnalysis.Service/WordReportHelper.cs b/ErrorAnalysis.Service/WordReportHelper.cs
index cfa78bb..3196d78 100644
--- a/ErrorAnalysis.Service/WordReportHelper.cs
+++ b/ErrorAnalysis.Service/WordReportHelper.cs
@@ -4,6 +4,7 @@
using SkiaSharp;
using static System.Net.Mime.MediaTypeNames;
using ErrorAnalysis.Service.Model;
+using System.Drawing;
namespace ErrorAnalysis.Service
{
@@ -85,13 +86,17 @@
var cellText = cell.GetText().Replace(ControlChar.Cell, "").Replace(ControlChar.ParagraphBreak, "");
if (cellText.StartsWith("$"))
{
- var property = properties.FirstOrDefault(p => p.Name == cellText.Trim().Replace("$", ""));
+ var name = cellText.Trim().Replace("$", "");
+ var property = properties.FirstOrDefault(p => p.Name == name);
if (property != null)
{
var valStr = property.GetValue(model).ToString();
+ var run = new Run(doc, valStr);
+ if (name == "Pass" || name == "Speed" || name == "Duration")
+ run.Font.Color = Color.Red; run.Font.Bold = true;
cell.FirstParagraph.RemoveAllChildren();
- cell.FirstParagraph.AppendChild(new Run(doc, valStr));
+ cell.FirstParagraph.AppendChild(run);
cell.FirstParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Right;
}
}
--
Gitblit v1.9.3