Integrating reporting functionality into applications is a very easy task using TX Text Control. The out-of-the-box ribbon tab "Reporting" provides all required features to add merge fields, repeating blocks and special fields.
The TXTextControl.DocumentServer.DataSources.DataSourceManager class is designed for handling all existing kinds of data sources that can be used with the TXTextControl.DocumentServer.MailMerge class.
After creating an application that uses the ribbon interface and the pre-designed ribbon tabs, your form should look similar to this:
The ribbon tab TXTextControl.Windows.Forms.Ribbon.RibbonReportingTab has the property TXTextControl.Windows.Forms.Ribbon.RibbonReportingTab.DataSourceManager which returns the connected DataSourceManager.
The DataSourceManager object provides methods to load data from various sources:
Consider the following classes that should be used as a data source:
The following code creates a new object and loads it into the DataSourceManager using the TXTextControl.DocumentServer.DataSources.DataSourceManager.LoadSingleObject method.
The drop-downs to insert merge fields and repeating merge blocks are filled automatically with the available values.
The DataSourceManager provides the TXTextControl.DocumentServer.DataSources.DataSourceManager.Merge method to merge a template with the current data to implement a preview functionality. The following code saves the template in a byte array, merges the template with data and loads back the resulting document into the TX Text Control:
Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.
See Windows Forms products