The TXTextControl.DocumentServer.MailMerge.FieldMerged returns useful information and options to manipulate the merged content in the TXTextControl.DocumentServer.MailMerge.FieldMergedEventArgs .
Since version X14 (24.0), the TXTextControl.DocumentServer.MailMerge.FieldMergedEventArgs.TableCell property returns a TXTextControl.TableCell object in case the merge field is positioned inside a table. This can be used to manipulate the table cell based on merged values.
Consider the following data structure and instance that is used to merge a template:
The following code creates a new instance of the reporting engine TXTextControl.DocumentServer.MailMerge , attaches the FieldMerged event and calls the TXTextControl.DocumentServer.MailMerge.MergeObjects method to merge a template with the created data object.
In the FieldMerged event, the field value is parsed and mapped to a color based on the value range. Accordingly, the background color of the outer table cell is highlighted.
The following screenshot shows the results of this merge process:
This is just one of many ideas what to do with the flexible reporting framework MailMerge to customize the merging process.
The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.
See Reporting products