Last week, I got hold of the latest internal beta release version of TX Text Control X10 (20.0) including an updated DocumentServer. We are very excited about the new reporting features and I thought to share some details over the next weeks.
Today, I would like to introduce the Report Data Source Configuration files. These files are created in the shipped Template Designer and include data connections and created data relations. It is not longer necessary to define data relations for Master-Detail blocks in your code. All you need to do is to open a data source in the Template Designer, create the relations and to save these settings as a Report Data Source Configuration file.
Finally, before merging your template, this configuration file can be specified and all data sources and relations are loaded automatically.
In the Template Designer, there is a new dialog to define the relations between several tables that are used in the designer for the preview of the report. Those settings can be directly saved as the XML based configuration files.
The unique advantage of this approach is the flexibility you gain with separate files that hold the data source information. You can easily use the same configuration file with different templates. Consider a situation when the data source is changed - maybe a new SQL Server. In this case, you don't need to change all your templates, but only one configuration file.
In the Template Designer, you simply save the configuration file and your template.
In Visual Studio, only one line of code is required to merge the template with the given data source and all defined relations. All you need to do is to drag and drop a Text Control and a MailMerge component onto your form in order to:
- Connect MailMerge with the TextControl instance using the TextComponent property
- Specify your data source configuration file path
- Specify your template file path
Finally, in your code, you simply need to call the Merge method of MailMerge to start the merge process.
This is just one new feature of Text Control Reporting X10 - stay tuned for more.