Bind a Report to a SQL Database
- 2 minutes to read
This tutorial describes how to bind a report to a SQL database.
Create a Data Model and Report
Define data models that obtain the data from your data providers. For this tutorial, prepare a data model connected to a SQL database.
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:
Click the main menu button and select Add Data Source to create a new data source.
On the first page of the invoked Data Source Wizard, select a SQL data model and click Next to proceed.
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.
In the invoked Query Builder, add data tables to the query and join them based on a key column.
Note
If the Custom SQL Query Execution Mode option is set to Execute SELECT Statements Only or Execute All in the General Settings window, you can write a custom SQL query instead of constructing it in the Query Builder. See Write a Custom SQL Query for more information.
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:
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.