Back to Devexpress

Bind a Report to a SQL Database

reportserver-401257-create-reports-web-report-designer-bind-a-report-to-data-bind-to-sql.md

latest1.8 KB
Original Source

Bind a Report to a SQL Database

  • Oct 23, 2019
  • 2 minutes to read

This tutorial describes how to bind a report to a SQL database.

Create a Data Model and Report

  1. Define data models that obtain the data from your data providers. For this tutorial, prepare a data model connected to a SQL database.

  2. Open an existing report or create a new report as described in the Create and Customize Reports document to get started.

Bind the Report to Data

To obtain a report’s dynamic data from an external data source, do the following:

  1. Click the main menu button and select Add Data Source to create a new data source.

  2. On the first page of the invoked Data Source Wizard , select a SQL data model and click Next to proceed.

  3. On the next page, choose tables, views and/or stored procedures to add to the data source. You can also create custom queries. To do this, click the Queries category’s plus button.

  4. Specify key fields to define master-detail relationships between queries. Click the plus button next to the master query, choose the detail query to add a new relationship and specify the relationship condition as shown in the following image:

  5. Click Finish to complete the wizard.

View the Result

The Field List displays the data source hierarchy after you connect a report to data.

The created data source is assigned to the report’s Data Source property.