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

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?) and merge blocks (what's this?).

Consider the following simple DataSet structure:

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

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

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.