# Use XML Schemas in TX Text Control Words

> TX Text Control Words connects to databases via MS SQL Server, ADO.NET, or ODBC, or loads XML schema files to provide field names and data relations for reporting templates. Exporting a DataSet schema to XML with WriteXmlSchema gives designers access to the full data structure.

- **Author:** Bjoern Meyer
- **Published:** 2014-03-07
- **Modified:** 2026-07-17
- **Description:** TX Text Control Words connects to databases via MS SQL Server, ADO.NET, or ODBC, or loads XML schema files to provide field names and data relations for reporting templates. Exporting a DataSet schema to XML with WriteXmlSchema gives designers access to the full data structure.
- **3 min read** (503 words)
- **Tags:**
  - Reporting
  - Tutorial
- **Web URL:** https://www.textcontrol.com/blog/2014/03/07/use-xml-schemas-in-tx-text-control-words/
- **LLMs URL:** https://www.textcontrol.com/blog/2014/03/07/use-xml-schemas-in-tx-text-control-words/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2014/03/07/use-xml-schemas-in-tx-text-control-words/llms-full.txt

---

With Text Control Reporting, the royalty-free template designer TX Text Control Words is where everything starts and a new report is born. You create templates in a well-known MS Word compatible editor with typical word processing elements such as tables, headers and footers and text frames. Connecting to data sources enables the insertion of proper field names and matching merge block elements.

Supported data sources are connections to existing installed databases such as MS SQL Server, all ADO.NET and ODBC connections and other installed adapters. Additionally, you can load XML files as data sources.

![Use XML schemas in TX Text Control Words](https://s1-www.textcontrol.com/assets/dist/blog/2014/03/07/a/assets/tx_txwords_database.webp "Use XML schemas in TX Text Control Words")When a data source is loaded, not only the data is available for a report preview, but also the structure and data relations to insert proper field names for prefixed fields ([what's this?](https://docs.textcontrol.com/textcontrol/windows-forms/article.reporting.technicalprefixed.htm)) and merge blocks ([what's this?](https://www.textcontrol.com/technology/reporting/)).

Consider the following simple DataSet structure:

![Use XML schemas in TX Text Control Words](https://s1-www.textcontrol.com/assets/dist/blog/2014/03/07/a/assets/tx_txwords_datastructure.webp "Use XML schemas in TX Text Control Words")Instead of providing your users access to the actual databases, an XML schema of databases without data can be created and used in TX Text Control Words. The following code shows how to export the data structure as XML from a DataSet:

```
DataSet ds = new DataSet();

DataTable dtCustomer = new DataTable("customer");
dtCustomer.Columns.Add("id");
dtCustomer.Columns.Add("company");
dtCustomer.Columns.Add("name");

DataTable dtInvoice = new DataTable("invoice");
dtInvoice.Columns.Add("id");
dtInvoice.Columns.Add("customerID");
dtInvoice.Columns.Add("invoiceNumber");

ds.Tables.AddRange(new DataTable[] { dtCustomer, dtInvoice });

DataRelation drCustomerInvoice = new DataRelation(
    "CustomerInvoice",
    dtCustomer.Columns["id"],
    dtInvoice.Columns["customerID"]);

ds.Relations.Add(drCustomerInvoice);

ds.WriteXmlSchema("dataset.xml");
```

If you want to create a dumb of the data as well, you can export the data and the structure with the following code:

```
ds.WriteXml("dataset.xml", XmlWriteMode.WriteSchema);
```

When loading this XML file using the **Load XML File** menu item of the **Select Data Source** drop-down button, the data structure, field names and data relations are available in the designer.

![Use XML schemas in TX Text Control Words](https://s1-www.textcontrol.com/assets/dist/blog/2014/03/07/a/assets/tx_txwords_database_2.webp "Use XML schemas in TX Text Control Words")When inserting a new field from the main table **customer**, the related table **invoice** is visible in the tree view automatically.

![Use XML schemas in TX Text Control Words](https://s1-www.textcontrol.com/assets/dist/blog/2014/03/07/a/assets/tx_txwords_database_3.webp "Use XML schemas in TX Text Control Words")Providing your users an XML file is a safe and reliable way to enable the available data structure in TX Text Control Words. Try it on your own and [download your trial version today](https://www.textcontrol.com/product/).

---

## 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

- [Creating Your First ASP.NET Reporting Application](https://www.textcontrol.com/blog/2020/01/01/creating-your-first-aspnet-reporting-application/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)
- [Using MailMerge with JSON Data](https://www.textcontrol.com/blog/2015/08/04/using-mailmerge-with-json-data/llms.txt)
- [Merging Documents with RESTful Web API's](https://www.textcontrol.com/blog/2015/07/31/merging-documents-with-restful-web-apis/llms.txt)
- [Windows Forms: Printing Multiple Pages Per Sheet](https://www.textcontrol.com/blog/2015/07/24/windows-forms-printing-multiple-pages-per-sheet/llms.txt)
- [Inserting Watermark Images to All Pages Dynamically](https://www.textcontrol.com/blog/2015/07/17/inserting-watermark-images-to-all-pages-dynamically/llms.txt)
- [Reporting: Sorting Merge Block Rows by Column Name](https://www.textcontrol.com/blog/2015/07/15/reporting-sorting-merge-block-rows-by-column-name/llms.txt)
- [MailMerge with the Entity Framework Using Database First](https://www.textcontrol.com/blog/2015/06/24/mailmerge-with-the-entity-framework-using-database-first/llms.txt)
- [Checked and Unchecked Check Boxes with IF Fields](https://www.textcontrol.com/blog/2015/03/25/checked-and-unchecked-check-boxes-with-if-fields/llms.txt)
- [Reporting: Conditional Formatted Text Blocks](https://www.textcontrol.com/blog/2015/03/13/reporting-conditional-formatted-text-blocks/llms.txt)
- [Reporting Best Practices and How-To Guides](https://www.textcontrol.com/blog/2015/02/05/reporting-best-practices-and-how-to-guides/llms.txt)
- [MailMerge: Master Table and Client Tables](https://www.textcontrol.com/blog/2015/01/28/mailmerge-master-table-and-client-tables/llms.txt)
- [MailMerge: Formatting Numeric Strings in Merge Fields](https://www.textcontrol.com/blog/2015/01/22/mailmerge-formatting-numeric-strings-in-merge-fields/llms.txt)
- [MailMerge: Merge CheckBoxes During the Merge Process](https://www.textcontrol.com/blog/2015/01/12/mailmerge-merge-checkboxes-during-the-merge-process/llms.txt)
- [MailMerge: Conditional INCLUDETEXT Fields](https://www.textcontrol.com/blog/2015/01/08/mailmerge-conditional-includetext-fields/llms.txt)
- [HTML5 Technical Considerations - The Concept Explained](https://www.textcontrol.com/blog/2014/10/16/html5-technical-considerations-the-concept-explained/llms.txt)
- [TX Text Control Web: Attaching Events to Ribbon Elements](https://www.textcontrol.com/blog/2014/10/07/tx-text-control-web-attaching-events-to-ribbon-elements/llms.txt)
- [TX Text Control Web: Customize the Ribbon Bar](https://www.textcontrol.com/blog/2014/10/03/tx-text-control-web-customize-the-ribbon-bar/llms.txt)
- [Text Control Web - Fundamental Concepts: The Data Source](https://www.textcontrol.com/blog/2014/10/02/text-control-web-fundamental-concepts-the-data-source/llms.txt)
- [Reporting: Removing Empty Table Rows](https://www.textcontrol.com/blog/2014/09/30/reporting-removing-empty-table-rows/llms.txt)
- [MS Word Content Controls Field Adapter Classes](https://www.textcontrol.com/blog/2014/08/05/ms-word-content-controls-field-adapter-classes/llms.txt)
- [Reporting: Merge Blocks and Structured Numbered Lists](https://www.textcontrol.com/blog/2014/07/29/reporting-merge-blocks-and-structured-numbered-lists/llms.txt)
- [Creating Avery Labels Using Text Control Reporting](https://www.textcontrol.com/blog/2014/07/22/creating-avery-labels-using-text-control-reporting/llms.txt)
