Bind a Report to a Database

<< Click to Display Table of Contents >>

Navigation:  User Interface Reference > Report Designer > Report Designer for WPF > Creating Reports > Providing Data > Binding a Report to Data >

Bind a Report to a Database

Interface Elements for Desktop > Report Designer > Report Designer for WPF > Creating Reports > Providing Data > Binding a Report to Data > Bind a Report to a Database

This document describes the steps required to connect a report to a database.

To bind a report to a database, do the following.

1.Create a new report.

2.Right-click the report and select Edit... in the context menu. In the invoked dialog, expand the Data Source drop-down and click the Add New button.

img123562

3.The first page of the invoked Data Source Wizard allows you to specify the data source type. Select Database and click Next to proceed.

img123568

4.On the next page, specify the data connection to be used. If it is absent in the list containing existing connections, select No, I'd like to specify the connection parameters myself and click Next.

img123985

5.On the next wizard page, define a custom connection string, or select from the supported data source types. Depending on the data provider selected, it may be necessary to specify additional connection options (such as authentication type and database name) on this page.

img123986

Click Next to proceed.

6.If server authentication is required for the selected database type, the next page will prompt you to specify whether or not you want to save the user credentials along with the connection string.

Select the required option and click Next.

img123987

7.On the next page, you can construct an SQL query to obtain data from the database, or select a stored procedure.

To construct an SQL query, click Run Query Builder...

img123988

8.In the invoked Query Builder window, select an item from the list of available tables on the left and drop it onto the list of data tables to be used.

img122798

9.Enable the check box near the added table to include all of its fields in the data view.

img122117

Click OK to exit the Query Builder. Click Finish to exit the Data Source Wizard.

The newly created SQL data source will be displayed in the Components node of the Report Explorer. Additionally, the hierarchy of the data source will be reflected by the Field List.

img123563

ExpandedCollapsed See Also

Bind a Report to an Entity Framework Data Source

Bind a Report to an Object Data Source

Bind a Report to an Excel Data Source

Query Builder

Copyright (c) 1998-2016 Developer Express Inc. All rights reserved.

Send Feedback on this topic to DevExpress.