All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

DxReportDesigner.DataSources Property

Provides access to the data sources available in the Report Designer.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.Blazor.Reporting.v21.1.JSBasedControls.dll

Declaration

[Parameter]
public Dictionary<string, object> DataSources { get; set; }

Property Value

Type Description
Dictionary<String, Object>

A dictionary that contains data sources and their names.

Remarks

Use this method to set up multiple data sources for a report. Multiple data sources allows you to assign an individual data source to a subreport, detail report, Chart, Sparkline or PivotGrid report controls.

The following code adds a SqlDataSource to a collection of data sources available in the Report Designer.

@page "/"
@using DevExpress.DataAccess.Sql


<DxReportDesigner ReportName="MyTableReport" Height="1000px" Width="100%" AllowMDI="false" DataSources="@myDataSources"/>

@code {
    Dictionary<string, object> myDataSources = new Dictionary<string, object>();

    protected override void OnInitialized()
    {
        AddDataSource();
    }


    void AddDataSource()
    {
        SqlDataSource ds = new SqlDataSource("NWindConnectionString");
        // Create a SQL query to access the Products data table.
        SelectQuery query = SelectQueryFluentBuilder.AddTable("Products").SelectAllColumnsFromTable().Build("Products");

        ds.Queries.Add(query);
        ds.RebuildResultSchema();
        myDataSources.Add("Northwind", ds);
    }
}
See Also