Committed by
Bjoern Meyer on Friday, February 15, 2019

Merge HTML Content into Merge Fields

ReportingCloud provides a way to merge formatted content into merge fields. The MergeSettings object used in the document/merge method received the new property mergeHtml that specifies whether field data can contain formatted HTML content or not.

If this property is set to true, field data can contain simple HTML formatting such as <strong>, <em> and <u>. The complete field data string must be enclosed in an <html> tag element:

In most cases, this feature has been requested to merge formatted comments into templates. Consider the following sample template:

The following code uses the .NET Framework SDK which is available as a NuGet package:

The screenshot below shows the formatted HTML that has been merged into the merge field:

The initial font name, font-size, color and font background color will be maintained on updating the text during the merge process.

Careful: Because font settings such as name, size and color are maintained, they cannot be changed or set in the HTML.

    Found a in our documentation?

    Edit this page on GitHub