TX Text Control .NET for WPF

Data Sources

Topic

If you are about to connect your WPF application's data to a template, the first question is what form that data has today: classes, ADO.NET tables, JSON or XML. MailMerge merges each of them, and one template serves them all as long as names and hierarchy match. Here you find which method merges which kind of data, how the Reporting tab receives the same data for template design and which page covers each kind.

How Data Reaches a Template

Two classes work with the data:

  • MailMerge merges it. A merge method takes the data and fills the template in a TextControl or ServerTextControl.
  • DataSourceManager describes it. The DataSourceManager of the WPF Reporting tab loads the same kinds of data, analyzes their tables, columns and relations and fills the drop-downs from which users insert fields and blocks.

Whatever the kind, the data becomes tables: the records you merge form the master table, whose columns fill merge fields, and nested collections or related tables fill merge blocks. Overview explains this model.

DataMerge withLoad for design withPage
A business object or a collection of them, dictionariesMergeObject, MergeObjectsLoadSingleObject, LoadObjects, LoadAssemblyObjects and Collections
A DataTable, or a DataSet with relationsMergeLoadDataTable, LoadDataSetDataSets and DataTables
A JSON stringMergeJsonDataLoadJsonJSON and XML
An XML file or stringMerge, after DataSet.ReadXmlLoadXmlFile, LoadXmlStringJSON and XML

Data source configuration files, which store a database connection for the merge, are a Windows Forms feature; Data Source Configuration Files explains what WPF applications do instead.

Data Sources in the Reporting Tab

With Select Data Source, users of the WPF Reporting tab load an XML file, an assembly or a JSON file for template design; data from a database reaches the tab only through your code, because the WPF tab can't connect a database. Reporting Ribbon and WPF Dialog Boxes describes the commands, and each page of this section shows the DataSourceManager method that loads its kind of data.

Choose a Data Source

If your data isUse
Classes or view models of your application, or data you query into objectsBusiness objects: Objects and Collections
Rows from a database in ADO.NET formA DataSet with relations: DataSets and DataTables
The response of a web service, a file from another systemJSON or XML: JSON and XML

Business objects and JSON carry the hierarchy of the document without extra relations, which makes them the most direct choices for new applications.

Pages in This Section