# DataSourceManager: Using the Ready-to-Use Reporting Dialog Boxes

> The TX Text Control DocumentServer namespace ships with seven ready-to-use reporting dialogs for data selection tasks: chart data relations, filter and sort, database connection, data source extraction, edit data relations, edit merge blocks, and insert merge block management.

- **Author:** Bjoern Meyer
- **Published:** 2018-11-27
- **Modified:** 2026-11-07
- **Description:** The TX Text Control DocumentServer namespace ships with seven ready-to-use reporting dialogs for data selection tasks: chart data relations, filter and sort, database connection, data source extraction, edit data relations, edit merge blocks, and insert merge block management.
- **4 min read** (656 words)
- **Tags:**
  - Mail Merge
  - Release
  - Reporting
  - Windows Forms
- **Web URL:** https://www.textcontrol.com/blog/2018/11/27/datasourcemanager-using-the-ready-to-use-reporting-dialog-boxes/
- **LLMs URL:** https://www.textcontrol.com/blog/2018/11/27/datasourcemanager-using-the-ready-to-use-reporting-dialog-boxes/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2018/11/27/datasourcemanager-using-the-ready-to-use-reporting-dialog-boxes/llms-full.txt

---

The TXTextControl.DocumentServer namespace encapsulates the Text Control reporting functionality, the TXTextControl.DocumentServer.Fields.FieldAdapter class, the TXTextControl.DocumentServer.DataSources.DataSourceManager class and also reporting dialog boxes that can be used in your applications.

These dialog boxes are ready-to-use for typical data selection tasks. The following dialog boxes are available:

- **ChartDataRelationDialog**  
    This dialog is used to set the data relations for charts.
    
    The following code loads a data source into a new instance of a DataSourceManager and opens a chart data relation dialog for a selected chart frame in TextControl:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadSingleObject(report);
    
    TXTextControl.DocumentServer.Windows.Forms.ChartDataRelationDialog dlg =
      new ChartDataRelationDialog(textControl1.Charts.GetItem(), dsManager);
    dlg.ShowDialog();
    ```
    
    The dialog lets the user select the parent and child tables that define the data relation and two data columns in the child table that are used as the x-axis label text and the actual data.
    
    ![ChartDataRelationDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_chart.webp "ChartDataRelationDialog")
- **FilterAndSortDialog**  
    This dialog is used to specify the filter and sorting settings for a merge block.
    
    The following code opens an instance of the dialog and passes the TXTextControl.DocumentServer.DataShaping.SortingInstruction class list to the TXTextControl.DocumentServer.DataSources.MergeBlockInfo class:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadSingleObject(report);
    
    FilterAndSortDialog filterSortDialog = new FilterAndSortDialog(dsManager.MasterDataTableInfo);
    filterSortDialog.ShowDialog();
    
    MergeBlockInfo mergeBlockInfo = new MergeBlockInfo("TableName");
    mergeBlockInfo.SortingInstructions = filterSortDialog.SortingInstructions.ToList();
    ```
    
    ![FilterAndSortDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_sorting.webp "FilterAndSortDialog")
- **DatabaseConnectionDialog**  
    This dialog allows the user to build connection strings and to connect to specific data sources.
    
    The following code opens an instance of the dialog. The connection string is applied to the *DataSourceManager*:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadSingleObject(report);
    
    TXTextControl.DocumentServer.Windows.Forms.DatabaseConnectionDialog dlg =
      new DatabaseConnectionDialog(dsManager);
    dlg.ShowDialog();
    ```
    
    ![DatabaseConnectionDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_database.webp "DatabaseConnectionDialog")
- **DataSourceExtractionDialog**  
    This dialog allows the user to save an excerpt from the currently loaded data source. An upper limit of extracted data rows can be specified in the dialog.
    
    The following code opens an instance of the dialog. The dialog returns the filename, the maximum number of exported rows and the selected DataTable:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadSingleObject(report);
    
    TXTextControl.DocumentServer.Windows.Forms.DataSourceExtractionDialog dlg =
      new DataSourceExtractionDialog(dsManager);
    dlg.ShowDialog();
    
    var fileName = dlg.FileName;
    var maxRows = dlg.MaxRows;
    var selectedTable = dlg.SelectedTable;
    ```
- **EditDataRelationsDialog**  
    This dialog allows the user to add or remove data relations to or from the current data source.
    
    The following code opens an instance of the dialog. The relations are applied to the connected DataSourceManager automatically:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadXmlFile("sample_db.xml");
    
    TXTextControl.DocumentServer.Windows.Forms.EditDataRelationsDialog dlg =
      new EditDataRelationsDialog(dsManager);
    dlg.ShowDialog();
    ```
    
    ![EditDataRelationsDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_relation.webp "EditDataRelationsDialog")
- **EditMergeBlocksDialog**  
    This dialog allows the user to remove or rename merge blocks contained in the current document.
    
    The following code opens an instance of the dialog with a connected TextControl instance that has merge blocks added to a document:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    
    dsManager.LoadSingleObject(report);
    TXTextControl.DocumentServer.Windows.Forms.EditMergeBlocksDialog dlg =
      new EditMergeBlocksDialog(dsManager, textControl1);
    dlg.ShowDialog();
    ```
    
    ![EditMergeBlocksDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_edit.webp "EditMergeBlocksDialog")
- **InsertMergeBlockDialog**  
    This dialog allows the user to design and insert a merge block based on the currently selected master table. It is inserted at the current input position of a given TextControl instance.
    
    The following code opens an instance of the dialog with a connected TextControl instance and the selected DataTableInfo object:
    
    ```
    DataSourceManager dsManager = new DataSourceManager();
    dsManager.LoadSingleObject(report);
    
    TXTextControl.DocumentServer.Windows.Forms.InsertMergeBlockDialog dlg = 
        new InsertMergeBlockDialog(dsManager, textControl1, dsManager.DataTables["Products"]);
    dlg.ShowDialog();
    ```
    
    ![InsertMergeBlockDialog](https://s1-www.textcontrol.com/assets/dist/blog/2018/11/27/a/assets/dialog_insert.webp "InsertMergeBlockDialog")

Text Control comes with out-of-the-box UI elements to create powerful reporting applications. At the same time, it is completely customizable and programmable.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [MailMerge: Conditional Rendering of Merge Blocks](https://www.textcontrol.com/blog/2018/11/28/mailmerge-conditional-rendering-of-merge-blocks/llms.txt)
- [TX Text Control 32.0 Has Been Released](https://www.textcontrol.com/blog/2023/09/13/tx-text-control-320-has-been-released/llms.txt)
- [TX Text Control 31.0 and TX Spell .NET 10.0 Have Been Released](https://www.textcontrol.com/blog/2022/09/07/tx-text-control-31-released/llms.txt)
- [TX Text Control 30.0 and TX Spell .NET 9.0 Have Been Released](https://www.textcontrol.com/blog/2021/11/29/tx-text-control-30-released/llms.txt)
- [TX Text Control X19 and TX Spell 8.0 Have Been Released](https://www.textcontrol.com/blog/2020/12/02/tx-text-control-x19-released/llms.txt)
- [TX Text Control X18 has been Released](https://www.textcontrol.com/blog/2020/03/16/tx-text-control-x18-released/llms.txt)
- [Merge Excel Documents into MailMerge Templates using IncludeText Fields](https://www.textcontrol.com/blog/2019/08/13/merge-excel-documents-into-mailmerge-templates/llms.txt)
- [MailMerge: Conditional Table Cell Colors using Filter Instructions](https://www.textcontrol.com/blog/2019/06/06/mailmerge-conditional-table-cell-colors-using-filter-instructions/llms.txt)
- [MailMerge: Using Filters to Remove Unwanted Rows](https://www.textcontrol.com/blog/2019/06/04/mailmerge-using-filters-to-remove-unwanted-rows/llms.txt)
- [TX Text Control X17 has been Released](https://www.textcontrol.com/blog/2019/05/28/tx-text-control-x17-released/llms.txt)
- [Text Control Roadmap 2019: High DPI Support, Forms, Node.js and Angular](https://www.textcontrol.com/blog/2019/03/12/text-control-roadmap-2019/llms.txt)
- [Merge Blocks in X16: Filtering, Sorting and Conditional Rendering](https://www.textcontrol.com/blog/2018/11/22/merge-blocks-in-x16-filtering-sorting-and-conditional-rendering/llms.txt)
- [TX Text Control X16 and TX Barcode .NET 5.0 Released](https://www.textcontrol.com/blog/2018/11/14/tx-text-control-x16-and-tx-barcode-net-50-released/llms.txt)
- [Sneak Peek X16: Filter and Sort MergeBlock Rows](https://www.textcontrol.com/blog/2018/04/26/sneak-peek-x16-filter-and-sort-mergeblock-rows/llms.txt)
- [X15: Merging Data into Chart Objects](https://www.textcontrol.com/blog/2018/01/05/merging-data-into-charts/llms.txt)
- [TX Text Control X15 and TX Spell .NET 7.0 Released](https://www.textcontrol.com/blog/2017/12/13/tx-text-control-x15-and-tx-spell-net-70-released/llms.txt)
- [Sneak Peek X15: MS Word Compatible Document Protection and Editable Regions](https://www.textcontrol.com/blog/2017/11/16/ms-word-compatible-editable-regions/llms.txt)
- [Different Ways to Create Documents using Text Control Products](https://www.textcontrol.com/blog/2017/10/17/ways-to-create-documents-using-text-control-products/llms.txt)
- [X14 Preview: New Integrated Reporting Dialog Boxes](https://www.textcontrol.com/blog/2016/11/24/x14-preview-new-integrated-reporting-dialog-boxes/llms.txt)
- [X14 Preview: Build Your Own Template Designer with the New DataSourceManager Class](https://www.textcontrol.com/blog/2016/11/15/x14-preview-build-your-own-template-designer-with-the-new-datasourcemanager-class/llms.txt)
- [MailMerge Improvements in X14: Event Arguments and JSON Data Sources](https://www.textcontrol.com/blog/2016/11/01/mailmerge-improvements-in-x14-event-arguments-and-json-data-sources/llms.txt)
- [Preview: JSON Support in MailMerge Version X14 (24.0)](https://www.textcontrol.com/blog/2016/05/18/preview-json-support-in-mailmerge-version-x14-240/llms.txt)
- [Windows Forms: Preview Mail Merge Results with the BindingNavigator and a BindingSource](https://www.textcontrol.com/blog/2016/01/08/windows-forms-preview-mail-merge-results-with-the-bindingnavigator-and-a-bindingsource/llms.txt)
- [TX Text Control 34.0 SP5 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/09/14/tx-text-control-34-0-sp5-is-now-available/llms.txt)
- [TX Text Control 34.0 SP4 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/05/20/tx-text-control-34-0-sp4-is-now-available/llms.txt)
