LinqReportEngine中渲染html内容多了一个回车符号

您好,我在使用Aspose.Words(25.2.0)中的LinqReportEngine渲染html内容时,以html块元素结尾时,渲染后会多出一个回车符,怎么了避免这个问题呢?
模板内容:

数据源:

替换后效果图:

@cqhg90258 您可以通过指定 ReportBuildOptions.RemoveEmptyParagraphs 选项来避免这种情况。

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("<<html [val]>>");
            
ReportingEngine engine = new ReportingEngine();
engine.Options = ReportBuildOptions.RemoveEmptyParagraphs;
engine.BuildReport(doc, "<p>test value</p><p>test value</p>", "val");
            
doc.Save(@"C:\Temp\out.docx");
1 Like