Reporting for WinForms - How to Create a Report Bound to the SQL Data Source
February 16, 2026 · View on GitHub
This example demonstrates how to create a master-detail report in code and use the SqlDataSource component to bind a report to the Microsoft SQL Server database.
The project implements the IConnectionProviderService descendant that connects the data source to the local MS SQL Server if the connection name is “MyRuntimeConnection”, and creates a connection to the Microsoft SQL Server database file for any other connection name.
The service is registered for the ReportDesignTool that invokes the Report Designer.

Files to Look At
- Form1.cs (Form1.vb)
- ReportCreator.cs (ReportCreator.vb)
- QueryHelper.cs (QueryHelper.vb)
- CustomConnectionProviderService.cs (CustomConnectionProviderService.vb)
Documentation
More Examples
- Data Access Library - How to Create Data Sources at Runtime
- How to Use the XRCrossTab Control to Create a Cross-Tab Report in Code
- Reporting for WinForms - Create a Report Dynamically and Bind It to a DataSet
Does This Example Address Your Development Requirements/Objectives?
(you will be redirected to DevExpress.com to submit your response)