The reporting engine supports various types of data sources that can be used to merge MS Word compatible documents with data. Supported data sources include DataSets, DataTables, Json objects, hierarchical IEnumerable objects and single business objects.
The encapsulates the complete handling, logic and ready-to-use dialog boxes for reporting template creation tasks. Essentially, the DataSourceManager provides all information required to create a fully-featured template designer. Like with MailMerge, a data source can be loaded from a DataSet, DataTable, Json, an object or XML. The following diagram shows the classes in detail:
But the DataSourceManager cannot only be used to manage data sources for template creation tasks - it can be also used to merge the actual document. The advantage: You can use more direct data sources to pass data to MailMerge including assemblies, XML files and strings and data source configuration files. The main reason for the merge capabilities of the DataSourceManager is to preview templates in a template designer. Therefore, it is not possible to trap MailMerge events such as the event.
The template must be loaded using the internal TX Text Control file format and resulting documents are returned as byte arrays in the internal TX Text Control format.
The DataSourceManager can load data from the following sources:
- DataSourceConfig files
- Single object
- XML file
- XML string
Conclusion: The merge capability of the DataSourceManager is a very powerful tool to manage loaded data sources and to merge data into templates when creating a template designer.