Like most other reporting technologies Docentric Toolkit also has a strong notion of Data Sources. When your .NET application renders a report the program/code from your application makes calls to the report engine using the report engine's APIs (Application Programming Interface). The engine always expects the document template as well as all the data sources (defined by the template) are provided. These two ingredients are needed for the report engine to create a report/document.

Data Source Kind

Docentric Toolkit Report Engine suports several kinds of data sources: .NET Object, XML and DTS Object as data sources. Mostly you will want to (re)use existing DAL (Data Access) objects as data sources for your reports. These can be of any .NET type, from simple DTOs (Data Transfer Object), to rich business objects.

.Net Objects

It is recommended that you define the data source .NET types before creating a report template, but it isn't mandatory. If you do so, you will be able to import these types' schemas into report templates through the Docentric Toolkit MS Word Add-In (see figure below). If data source schemas are available while authoring templates in MS Word using Docentric Toolkit MS Word Add-In, it will greatly improve user's experience and productivity. But in a dynamic case where schema won't be available, the Add-In will not help the user with suggesting him the data source member names.

.Net object as a Data Source

XML

When you prefere to feed your data into reports in the form of XML it is also possible to use schema information in order to achive high RAD (Rapid Application Development) factor. The Docentric Toolkit Add-In for MS Word allows either importing an XSD file or infering the schema from a sample XML file. It is recommended that you prepare at least a sample XML file before you start designing a report template, although this step is not mendatory. If you can provide a schema for a report template, the MS Word Add-In will be able to offer you great support during the report template design (see figure below).

XML as a Data Source

Data Sets and Data Tables

DataSets cannot be used as data sources directly. In case you retrieve, store and manipulate the data in you .Net application DataSets and DataTables, you will first have to convert them to .NET objects (ORM) or XML documents or fragments. If you do not want to create classes just for this purpose, you can create a simple helper method that can convert a DataTable to an XML fragment which can in turn be used as a data source. Strongly Typed DataSets do not fall into this category because they can be treated as normal .Net objects with business values exposed through normal properties and hence be directly used as data sources.