# TX Text Control MailMerge Features Outlined

> The MailMerge component of TX Text Control provides dynamic merge fields with formatting options, auto-populated date fields, conditional IF fields with comparison operators, IncludeText sub-templates for nested documents, and repeating blocks for master-detail relationship views.

- **Author:** Bjoern Meyer
- **Published:** 2012-12-18
- **Modified:** 2026-07-17
- **Description:** The MailMerge component of TX Text Control provides dynamic merge fields with formatting options, auto-populated date fields, conditional IF fields with comparison operators, IncludeText sub-templates for nested documents, and repeating blocks for master-detail relationship views.
- **5 min read** (879 words)
- **Tags:**
  - Tutorial
- **Web URL:** https://www.textcontrol.com/blog/2012/12/18/tx-text-control-mailmerge-features-outlined/
- **LLMs URL:** https://www.textcontrol.com/blog/2012/12/18/tx-text-control-mailmerge-features-outlined/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2012/12/18/tx-text-control-mailmerge-features-outlined/llms-full.txt

---

Flow Type Layout Reporting is an easy, but powerful way to create reports based on word processing document templates. Aside from formatting and layout features such as column layout, headers and footers or page borders, TX Text Control's MailMerge component supports various reporting features.

These features range from merge and date fields over dynamic images to nested repeating blocks alias master-detail views.

Below is an active image map that illustrates the most important reporting features. Simply click on one of the blinking areas to get a detailed description:

![TX Text Control MailMerge features outlined](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/mailmerge_animation.webp "TX Text Control MailMerge features outlined")<a name="mergefield">Dynamic Merge Fields
--------------------

</a>These merge fields are the actual data fields that can be replaced with database content. They are compatible to MS Word and are formatted in the template. The merged text is formatted with the pre-defined style and formatting.

![Merge field options](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/merge_field_options.webp "Merge field options")A merge field has additional format properties and options:

- Format: UPPERCASE
- Format: lowercase
- Format: First capital
- Format: Title Case
- Text before
- Text after

Related event during the merge process: [FieldMerged](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.fieldmerged.event.htm)

<a name="date">Date Fields
-----------

</a>A date field is automatically merged with the current date and time in a specified string format. In your merge code, you don't need to care about these date fields. They are automatically handled during the merge process.

The following screenshot shows the *Date Field Options* dialog with the different format settings:

![Date field options](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/date_field_options.webp "Date field options")Related event during the merge process: [FieldMerged](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.fieldmerged.event.htm)

<a name="include">IncludeText Fields
------------------

</a>The MS Word compatible *IncludeText* field can be used to include sub-templates into the document. Sub-templates itself can contain other sub-templates, merge fields or merge blocks. You can nest unlimited levels of sub-templates in a merge process - only infinite loops are trapped.

A sub-template can be a single formatted word or a whole document with several pages - it doesn't matter. Additionally, an event is triggered when an *IncludeText* field is handled. It allows you to replace the whole sub-template in the event.

![IncludeText field options](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/include_field_options.webp "IncludeText field options")Related event during the merge process: [IncludeTextMerging](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.includetextmerging.event.htm)

<a name="if">Conditional If Fields
---------------------

</a>A conditional *If* field compares the value of a specific *MergeField* to a given value in order to return a *true* or a *false* text.

The following operators are supported:

- Equals
- NotEqual
- LessThan
- GreaterThan
- GreaterThanOrEqualTo
- LessThanOrEqualTo

![If field options](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/if_field_options.webp "If field options")Multiple *If* fields can be inserted adjacent to each other. This allows simple, but powerful conditional constructs like in the below sample.

A large green "UP" should be inserted, if the stock's "day change" is positive or a red "DOWN" when this value is negative.

![Special field](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/tutorial_5.webp "Special field")![Special field](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/tutorial_4.webp "Special field")Two adjacent IF fields with different colors are added at the specific position:

![Special field](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/tutorial_6.webp "Special field")The condition for the first field would be:

**If merge field *dDayChange* is less than 0 then return *Down*.**

Related event during the merge process: [FieldMerged](https://docs.textcontrol.com/textcontrol/windows-forms/ref.txtextcontrol.documentserver.mailmerge.fieldmerged.event.htm)

<a name="master">Master-Detail Relationship Views
--------------------------------

</a>Creating powerful hierarchical reports is the strength of TX Text Control. Nested repeating blocks with master-detail relationship views can be easily inserted. It doesn't matter what's repeated in the block: A table row, paragraphs, images or text frames.

A master-detail relationship is a 1:n (one-to-many) type relationship. A typical example for such a relationship is a purchase order and a set of items that belongs to each purchase order. This allows you to create complex nested reports in a very easy way.

![Master-Detail Relationship Views](https://s1-www.textcontrol.com/assets/dist/blog/2012/12/18/a/assets/master_detail.webp "Master-Detail Relationship Views")<a name="page">MS Word Compatible Page Numbering
---------------------------------

</a>Page numbers can be added to headers and footers in different sections of a document. These page numbers are populated automatically during the merge process. The current page and the total number of pages fields are supported.

A document can consist of an unlimited number of sections with different page formatting and orientation. Page numbering can be applied for each header and footer in every section.

These are only a few of the supported features in the powerful Flow Type Layout Reporting solution of TX Text Control.

Give It a Try and Download the Trial Today!
-------------------------------------------

[Fully Featured, 30 Day Trial Version ](https://www.textcontrol.com/product/ "Fully Featured, 30 Day Trial Versions")

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Windows Forms Tutorial: Create Your First Windows Forms C# Application](https://www.textcontrol.com/blog/2024/08/26/windows-forms-tutorial-create-your-first-windows-forms-csharp-application/llms.txt)
- [How to Mail Merge MS Word DOCX Documents in ASP.NET Core C#](https://www.textcontrol.com/blog/2023/10/16/how-to-mail-merge-ms-word-docx-documents-in-aspnet-core-csharp/llms.txt)
- [Creating an Angular Document Editor Application with a Node.js WebSocket Server](https://www.textcontrol.com/blog/2023/08/24/creating-an-angular-document-editor-application-with-a-nodejs-websocket-server/llms.txt)
- [Adding SVG Watermarks to Documents](https://www.textcontrol.com/blog/2022/01/28/adding-svg-watermarks-to-documents/llms.txt)
- [Using MailMerge in ASP.NET Core 6 Web Applications](https://www.textcontrol.com/blog/2022/01/27/using-mailmerge-in-aspnet-core-6-web-applications/llms.txt)
- [DocumentViewer for React Prerelease](https://www.textcontrol.com/blog/2020/10/27/document-viewer-for-react-prerelease/llms.txt)
- [New DocumentViewer Signature Tutorial Sample](https://www.textcontrol.com/blog/2020/08/18/new-documentviewer-signature-tutorial-sample/llms.txt)
- [Creating an ASP.NET MVC DocumentViewer Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-documentviewer-application-with-razor/llms.txt)
- [Creating Your First Windows Forms Application with C#](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-windows-forms-application-with-csharp/llms.txt)
- [Creating Your First WPF Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-wpf-application/llms.txt)
- [Creating a WPF Ribbon Application](https://www.textcontrol.com/blog/2020/01/01/creating-a-wpf-ribbon-application/llms.txt)
- [Integrate Document Editing into any HTML Client using the HTML Widget](https://www.textcontrol.com/blog/2020/01/01/integrate-document-editing/llms.txt)
- [Creating an ASP.NET MVC Application With Razor](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-mvc-application-with-razor/llms.txt)
- [Creating A Windows Forms Ribbon Application](https://www.textcontrol.com/blog/2020/01/01/creating-a-windows-forms-ribbon-application/llms.txt)
- [Creating Your First ASP.NET Reporting Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-aspnet-reporting-application/llms.txt)
- [Creating an ASP.NET Web Forms AJAX Application](https://www.textcontrol.com/blog/2020/01/01/creating-an-aspnet-web-forms-ajax-application/llms.txt)
- [Creating a WebSocket Server Project with Node.js](https://www.textcontrol.com/blog/2020/01/01/creating-a-websocket-server-project-with-nodejs/llms.txt)
- [Creating an Angular Document Editor Application](https://www.textcontrol.com/blog/2020/01/01/creating-an-angular-document-editor-application/llms.txt)
- [ReportingCloud .NET Core Quickstart Tutorial](https://www.textcontrol.com/blog/2019/07/24/reportingcloud-dotnet-core-quickstart-tutorial/llms.txt)
- [Document Permissions and Password Encryption](https://www.textcontrol.com/blog/2019/07/05/document-permissions-and-password-encryption/llms.txt)
- [New Online Sample: Build your First Report](https://www.textcontrol.com/blog/2019/07/03/build-your-first-report/llms.txt)
- [Create your First Document with ReportingCloud](https://www.textcontrol.com/blog/2019/02/19/create-your-first-document-with-reportingcloud/llms.txt)
- [MailMerge: Starting Each Merge Block on a New Page](https://www.textcontrol.com/blog/2016/09/09/mailmerge-starting-each-merge-block-on-a-new-page/llms.txt)
- [Windows Forms and WPF: End a List on Return when Line is Empty](https://www.textcontrol.com/blog/2016/08/26/windows-forms-and-wpf-end-a-list-on-return-when-line-is-empty/llms.txt)
- [Using IFormattedText Objects to Access Elements Across All TextParts in a Document](https://www.textcontrol.com/blog/2016/08/25/using-iformattedtext-objects-to-access-elements-across-all-textparts-in-a-document/llms.txt)
