Skip to main content
All docs

DataSourceManager.GetDataSources(XtraReport, Boolean) Method

Returns all report data sources.

Namespace: DevExpress.XtraReports

Assembly: DevExpress.XtraReports.v23.1.dll

NuGet Package: DevExpress.Reporting.Core


public static IEnumerable<object> GetDataSources(
    XtraReport report,
    bool includeSubReports = false


Name Type Description
report XtraReport

A report instance.

Optional Parameters

Name Type Default Description
includeSubReports Boolean False

true to include data sources from subreports; otherwise, false.


Type Description

A collection of report data sources.


The following code sample shows how to get all report data sources (except for subreport data sources), iterate through these data sources, and update settings (the ConnectionName property) of each data source whose type is SqlDataSource.

using DevExpress.DataAccess.Sql;
using DevExpress.XtraReports;

var report = new XtraReport1();

var dataSources = DataSourceManager.GetDataSources(report, includeSubReports: false);

foreach (var dataSource in dataSources) {
    if (dataSource is SqlDataSource) {
        (dataSource as SqlDataSource).ConnectionName = "nwind";
See Also