Fundamental Concepts: The Data Source

The most typical application is the creation of templates for the Text Control Reporting engine DocumentServer.MailMerge. The ribbon tab Reports 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:

1. Open TX Text Control Words that is located in your Windows start menu or start screen

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

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

5. 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.

6. This XML file can be loaded using the LoadXMLDatabase method of Web.TextControl:

[C#]
TextControl1.LoadXMLDatabase("datasource_excerpt.xml");
[Visual Basic]
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.