Skip to main content

Specify Data Source Settings (Database)

  • 3 minutes to read

This page appears if you select Database on the start page.

Web Data Source Wizard - Specify Data Source Settings for Database

Choose a Data Connection

Select an item from the data connection list.

Web Data Source Wizard -- Choose a Data Connection

For information on how to register data connections in your application, refer to the following help topics:

Choose Queries

Select tables, views, or stored procedures to include them in a data source as separate queries.

Schema loading in Data Source Wizard is optimized – the schema is loaded on demand when nodes are expanded to display child elements. You can use the DevExpress.Analytics.Wizard.AutoQueryPreload function to load the entire schema at once.

Web Data Source Wizard - Choose Queries for Database

Check specific data fields if needed:

Web Data Source Wizard - Choose Specific Fields in Queries

To join multiple data tables and shape the data, click the Queries category plus button. You can now create queries in the invoked Query Builder:

Web Data Source Wizard - Query Builder

If you enabled custom SQL queries, the plus button opens a context menu. You can choose to run the Query Builder or Custom SQL Editor.

Web Data Source Wizard - Add New Queries

Important

Enable custom SQL queries only if you trust your users and environment. Make sure that you provide secure query validation to protect your database. See General Security Considerations for more information.

Click the Edit button (The Edit icon) to customize a query. Click the Delete button (The Delete icon) to remove a query.

When you click Finish and close the wizard, the data source appears under the Data Sources node in the Report Explorer. The Field List shows the data source structure.

Web Report Designer - Field List

Configure Master-Detail Relationships

This step appears if you select two or more queries.

To create a master-detail relationship, click the master table’s plus button. Next, select the detail table in the list and connect the key fields.

Web Data Source Wizard - Configure Master-Detail Relationship

After the wizard is completed, the Field List shows the master-detail hierarchy.

Web Report Designer - Field List

Configure Query Parameters

This step appears if you select a parameterized stored procedure or create a custom query.

Select a query and click the plus button to add a new parameter.

Web Data Source Wizard -- Configure Query Parameters

Click the Edit button (The Edit Icon) to customize the parameter. Click the Delete button (The Delete Icon) to remove it.

Use the following approaches to specify a parameter value:

  • Assign a static value

    Select the query parameter type from the Type drop-down list. Specify a value that matches the selected type.

    Web Data Source Wizard -- Assign a Static Value to a Query Parameter

  • Provide a dynamic parameter value

    Set Type to Expression and specify the Result Type. Click the Value ellipsis button to construct an expression in the invoked Expression Editor.

    Web Data Source Wizard -- Query Parameter Values with Expressions

    If you design the report in the wizard, you can map a query parameter to an existing report parameter. Use the ?parameterName syntax.

    Web Data Source Wizard - Bind Query Parameter to Report Parameter

    For more scenarios with query parameters, refer to the following topic: Specify Query Parameters.