Text Control Web - Fundamental Concepts: The Data Source
The TX Text Control HTML5 Web editor populates its Mailings ribbon tab from Database Excerpt XML files that define merge fields and blocks. Developers generate these XML excerpts using TX Text Control Words and load them into the Web editor via the LoadXMLDatabase method.

The most typical application is the creation of templates for the Text Control Reporting engine DocumentServer.MailMerge. The ribbon tab Mailings is designed to insert merge fields and merge blocks compatible to the reporting classes of TX Text Control.
The drop-down buttons Select Master Table, Insert Merge Field and Insert Merge Block are pre-filled with items of a specific Database Excerpt XML file that can be loaded programmatically.
This XML database file contains table definitions, relations and row excerpts to provide a preview of the report. This XML file can be easily created using the Windows version of the template designer TX Text Control Words. To create such an XML file, follow the next easy steps:
-
Open TX Text Control Words that is located in your Windows start menu or start screen.

-
Open the Mailings tab and choose Data Source from the Data Source drop-down button.

-
Follow the next steps and instructions of the Choose Data Source dialog to open your preferred data source.

-
If your data source has been added successfully, you can save the excerpt using the Save Excerpt menu item of the Data Source drop-down button. In the opened dialog Save Data Base Excerpt, select the root table and set the maximum number of exported rows. Then select an export file name and confirm with OK.

-
This XML file can be loaded using the LoadXMLDatabase method of Web.TextControl:
[C#] TextControl1.LoadXMLDatabase("datasource_excerpt.xml")[VB.NET] TextControl1.LoadXMLDatabase("datasource_excerpt.xml")
Additionally, the data source can be also loaded from an XMLDocument or FileStream and a DataSet can be directly loaded using the LoadDataSet method.
Reporting
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.
Related Posts
Creating Your First ASP.NET Reporting Application
The MailMerge and ServerTextControl components of TX Text Control .NET Server for ASP.NET enable server-side reporting in Web Forms. A template.docx merges with XML data via a button click…
New Online Sample: Build your First Report
A new interactive online demo walks through building a report with TX Text Control in three steps: preparing JSON data in a live editor, creating a template with merge fields and repeating blocks,…
ReportingDocumentationReportingCloud
Create your First Document with ReportingCloud
ReportingCloud documentation now includes interactive tutorials for creating documents without code. Users enter an API key, choose a format such as PDF or DOCX, customize the merge data payload,…
MailMerge: Starting Each Merge Block on a New Page
Merge blocks in TX Text Control repeat based on matching data rows. Applying ParagraphFormat.PageBreakBefore to the first paragraph of a block forces each repetition onto a new page. Section…
Using MailMerge with JSON Data
Merge document templates with JSON data using TX Text Control MailMerge by converting nested JSON strings into DataSet objects via Newtonsoft.Json. The JSON is first transformed to XML, then…
