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.