# Using the Reporting RibbonTab

> The TX Text Control RibbonReportingTab provides built-in ribbon UI for inserting merge fields and repeating blocks into reporting templates. The DataSourceManager loads data from objects, JSON, XML, and assemblies, and its Merge method enables previewing merged output directly.

- **Author:** Bjoern Meyer
- **Published:** 2018-04-16
- **Modified:** 2026-07-17
- **Description:** The TX Text Control RibbonReportingTab provides built-in ribbon UI for inserting merge fields and repeating blocks into reporting templates. The DataSourceManager loads data from objects, JSON, XML, and assemblies, and its Merge method enables previewing merged output directly.
- **3 min read** (418 words)
- **Tags:**
  - Reporting
  - Ribbon
  - Windows Forms
- **Web URL:** https://www.textcontrol.com/blog/2018/04/16/using-the-reporting-ribbontab/
- **LLMs URL:** https://www.textcontrol.com/blog/2018/04/16/using-the-reporting-ribbontab/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2018/04/16/using-the-reporting-ribbontab/llms-full.txt

---

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 classis 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:

![TX Text Control in Visual Studio](https://s1-www.textcontrol.com/assets/dist/blog/2018/04/16/a/assets/vs_reporting.webp "TX Text Control in Visual Studio")

The ribbon tab TXTextControl.Windows.Forms.Ribbon.RibbonReportingTab classhas the TXTextControl.Windows.Forms.Ribbon.RibbonReportingTab.DataSourceManager propertywhich returns the connected *DataSourceManager*.

The *DataSourceManager* object provides methods to load data from various sources:

- LoadAssembly
- LoadDataSet
- LoadDataTable
- LoadJson
- LoadObjects
- LoadSingleObject
- LoadXmlFile
- LoadXmlString

Consider the following classes that should be used as a data source:

```
public class Report
{
    public string Name { get; set; }
    public List<Sale> Sales { get; set; } = new List<Sale>();
}

public class Sale
{
    public Customer Customer { get; set; }        
    public Product Product { get; set; }
}

public class Product
{
    public string Name { get; set; }
    public decimal Price { get; set; }
}

public class Customer
{
    public string Name { get; set; }
    public int Id { get; set; }
    public string Street  { get; set; }
    public string City { get; set; }
    public int Zip { get; set; }
}
```

The following code creates a new object and loads it into the *DataSourceManager* using the TXTextControl.DocumentServer.DataSources.DataSourceManager.LoadSingleObject method.

```
Report report = new Report() { Name = "Test Report 2018" };
report.Sales.Add(new Sale()
{
    Customer = new Customer()
    {
        Name = "Customer 1",
        City = "Charlotte",
        Id = 1,
        Street = "6672 Test Street",
        Zip = 27781
    },
    Product = new Product()
    {
        Name = "My Product 1",
        Price = 7782.12m
    }
});

DataSourceManager dsManager = ribbonReportingTab1.DataSourceManager;
dsManager.LoadSingleObject(report);
```

The drop-downs to insert merge fields and repeating merge blocks are filled automatically with the available values.

![TX Text Control in Visual Studio](https://s1-www.textcontrol.com/assets/dist/blog/2018/04/16/a/assets/vs_reporting2.webp "TX Text Control in Visual Studio")

The *DataSourceManager* provides the TXTextControl.DocumentServer.DataSources.DataSourceManager.Merge methodto 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:

```
// save the document
byte[] bDocument = null;
textControl1.Save(out bDocument, TXTextControl.BinaryStreamType.InternalUnicodeFormat);

// create the preview
IList<byte[]> bResults = ribbonReportingTab1.DataSourceManager.Merge(bDocument, 1, textControl1);

// load the preview into the Text Control
textControl1.Load(bResults[0], TXTextControl.BinaryStreamType.InternalUnicodeFormat);
```

---

## 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

- [Getting Started: Creating a .NET 8 Windows Forms Ribbon Application with Sidebar Support](https://www.textcontrol.com/blog/2024/02/28/getting-started-creating-a-net-8-windows-forms-ribbon-application-with-sidebar-support/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)
- [Windows Forms Ribbon: Displaying User-Friendly Merge Field Names](https://www.textcontrol.com/blog/2020/01/14/displaying-user-friendly-merge-field-names-in-the-ribbon/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)
- [Create and Modify Adobe PDF Documents within your .NET Application](https://www.textcontrol.com/blog/2019/05/27/create-and-modify-adobe-pdf-documents/llms.txt)
- [Creating Templates: Typical Invoice Elements](https://www.textcontrol.com/blog/2019/04/16/typical-invoice-elements/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)
- [MailMerge: Conditional Rendering of Merge Blocks](https://www.textcontrol.com/blog/2018/11/28/mailmerge-conditional-rendering-of-merge-blocks/llms.txt)
- [DataSourceManager: Using the Ready-to-Use Reporting Dialog Boxes](https://www.textcontrol.com/blog/2018/11/27/datasourcemanager-using-the-ready-to-use-reporting-dialog-boxes/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)
- [Customizing the Windows Forms Ribbon](https://www.textcontrol.com/blog/2018/09/17/customizing-the-windows-forms-ribbon/llms.txt)
- [Generate Word Documents from Templates in .NET](https://www.textcontrol.com/blog/2018/08/10/generate-word-documents-from-templates-in-net/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)
- [Version X14: Customizing the Text Control Ribbon Control](https://www.textcontrol.com/blog/2017/01/02/version-x14-customizing-the-text-control-ribbon-control/llms.txt)
