# Mail Merge and Reporting

> Create documents from templates in WPF: the Reporting ribbon tab, MailMerge in code, data sources, merge fields and blocks, preview, styling and events.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Mail Merge and Reporting
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/llms-full.txt

---

## On This Page

- [How Mail Merge Works](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/#how-mail-merge-works)
- [Find the Right Page](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/#find-the-right-page)
- [Recommended Order](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/#recommended-order)
- [Pages in This Section](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/#pages-in-this-section)
- [Related Sections](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/#related-sections)

---

## In This Section

- [Merge Blocks](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/blocks/llms.txt): Repeat content with merge blocks in WPF: InsertMergeBlockDialog results, paragraph blocks with MergeBlockSettings, GetBlockNames and the current block.
- [Conditional Content](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/conditional-content/llms.txt): Conditional content in WPF mail merge: IF fields created with IfField, blocks for optional sections, BlockMergingCondition, IncludeTextMerging and FieldMerged.
- [Data Sources](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/data-sources/llms.txt): Data sources for mail merge in WPF: objects, DataSets, JSON and XML, the MailMerge method for each and the DataSourceManager of the WPF Reporting tab.
- [Merge Events](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/events/llms.txt): Use the .NET events of MailMerge in WPF: FieldMerged, BlockMerging, BlockRowMerged, DataRowMerged and more, their order, a merge log and Cancel.
- [Merge Fields](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/fields/llms.txt): Set MergeField options in WPF: numeric and date formats in all text parts, DateField, a text for fields without data, HTML values and FormFieldMergeType.
- [Images and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/images-barcodes/llms.txt): Fill image and barcode placeholders in WPF: TXTextControl.Image, the WPF TXBarcodeControl, UpperTextLength, Base64 and SVG data, ImageMerged and BarcodeMerged.
- [Nested Blocks and Master-Detail Reports](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/nested-blocks/llms.txt): Nest merge blocks for master-detail reports in a WPF app: nested JSON, ChildBlocks in code, the block hierarchy, business objects and DataSets with relations.
- [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/overview/llms.txt): Plan mail merge in a WPF app: pre-shaped data, MailMerge created in code for the WPF TextControl, one document per record with DataRowMerged and printing.
- [Reporting Ribbon and WPF Dialog Boxes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/ribbon-dialogs/llms.txt): The WPF RibbonReportingTab: its groups, the Field Navigation sidebar in XAML, the DocumentServer.WPF dialog windows, FieldAdapter.ShowDialog and FindName.
- [Sorting and Filtering](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/sorting-filtering/llms.txt): Filter and sort the rows of merge blocks in WPF: FilterInstruction and SortingInstruction, Apply, the WPF FilterAndSortDialog and BlockMergingCondition.
- [Formatting and Styling](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/styling/llms.txt): Style merged WPF documents: template formatting that survives the merge, alternate row colors, TableCell and MergedField changes in FieldMerged handlers.
- [Subtemplates](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/subtemplates/llms.txt): Include subtemplates in WPF mail merge templates: INCLUDETEXT fields, the IncludeText class, MailMerge.SearchPath and content supplied in IncludeTextMerging.
- [Template Design](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/template-design/llms.txt): Plan WPF mail merge templates: sample data, inspecting the DataSourceManager of the Reporting tab, TX versus DOCX storage, layout rules and a template test.
- [Template Preview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/template-preview/llms.txt): Add a merge preview to a WPF template designer: a ToggleButton, DataSourceManager.Merge, MergeSettings, read-only EditMode and paging through records.

---

## Nearby

- **Previous:** [Content Controls](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-processing/content-controls/llms.txt)
- **Next:** [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/mail-merge/overview/llms.txt)
