[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Collapse]Reporting
 [Expand]Product Information
 [Expand]Getting Started with DevExpress Reporting
 [Expand]Creating Popular Reports
 [Collapse]Detailed Guide to DevExpress Reporting
   Introduction to Banded Reports
  [Collapse]Providing Data to Reports
   [Expand]Data Binding Overview
   [Collapse]Tutorials and Code Examples
     Bind a Report to a Database
     Bind a Report to a Stored Procedure
     Bind a Report to an MDB Database (Runtime Sample)
     Bind a Report to a Microsoft SQL Server Database (Runtime Sample)
     Register a Custom Schema Provider for a Synonym Database
     Bind a Report to an Object Data Source
     Bind a Report to a Collection that Implements the ITypedList Interface (Runtime Sample)
     Bind a Report to an Array List (Runtime Sample)
     Bind a Report to a List Object at Design Time and Provide Data at Runtime
     Bind a Report to an Entity Framework Data Source
     Bind a Report to an Entity Framework Stored Procedure
     Filtering an Entity Framework Data Source
     Bind a Report to a CSV File
     Bind a Report to a CSV File (Runtime Sample)
     Bind a Report to an Excel Workbook
     Bind a Report to an Excel Workbook (Runtime Sample)
     Bind a Report to an XML File
     Bind a Report to an XML File (Runtime Sample)
     Bind a Report to a Data Source Schema
     Bind a Report to Multiple Data Sources
     Bind a Report to Multiple Data Tables
  [Expand]Using Report Controls
  [Expand]Shaping Report Data
   Laying out Dynamic Report Contents
  [Expand]Customizing Appearance
  [Expand]Adding Navigation
  [Expand]Providing Interactivity
  [Expand]Adding Customary Information
  [Expand]Merging Reports
  [Expand]Using Expressions
  [Expand]Storing and Distributing Reports
  [Expand]Reporting API
 [Expand]Visual Studio Report Designer
 [Expand]Creating End-User Reporting Applications
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
This documentation page describes implementations made in our v17.2 release cycle. To learn about functionality shipping with v18.1, navigate to our updated help file experience at docs.devexpress.com. Learn More

Bind a Report to a Stored Procedure

This tutorial demonstrates how to bind a report to a stored procedure provided by an SQL data source.

To bind to a stored procedure, do the following.

  1. 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...

    Note

    The Data Source Wizard is more appropriate for binding a report to a stored procedure than the Report Wizard, because the last one does not provide the possibility to specify dynamic values for the procedure's parameter. Thus, create an empty report and run the Data Source Wizard to bind the report to a stored procedure and specify a data source for procedure parameters.

  2. On the first page of the invoked Data Source Wizard, select Database and click Next.

  3. 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.

  4. On the next page, you can define a custom connection string or select from the list of supported data providers. 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.

    To proceed to the next wizard page, click Next.

  5. Click Next on the following page to save the created connection string to the configuration file.

  6. 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.

  7. 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.

    Click the Preview button and select a query to preview the result of the stored procedure execution with the specified parameters.

    The following image demonstrates the Data Preview displaying the resulting data sample. Click Close to exit the preview.

    Click Finish to exit the wizard.

Expanded See Also

Is this topic helpful?​​​​​​​