xtrareports-10555-feature-guide-to-devexpress-reports-bind-reports-to-data-sql-database-bind-a-report-to-a-stored-procedure.md
This tutorial demonstrates how to bind a report to a stored procedure for an SQL data source.
To bind to a stored procedure, do the following:
Click the report’s smart tag. In the invoked actions list, expand the drop-down menu for the DataSource property and click Add Report Data Source…
On the first page of the invoked Data Source Wizard, select Microsoft SQL Server and click Next.
The next page allows you to specify whether you want to use an existing data connection or create a new data connection with custom parameters. Select the first option to create a new connection and click Next.
On the next page, configure connection parameters. 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.
Click Next on the following page to save the created connection string to the configuration file.
On the next page, you can choose which tables, views, and/or stored procedures to add to the report. Expand the Stored Procedures category, select the required stored procedure from the list of available stored procedures and click Next.
Then the wizard generates query parameters for each stored procedure parameter. The next wizard page presents the generated query parameters. You can assign a static value or an expression to a parameter. In addition, you can map a report parameter to a query parameter. This is helpful when end users specify parameter values in the report’s Preview. For details on how to configure query parameters, refer to the Query Parameters topic.
See Also