All docs
V21.1
21.2 (EAP/Beta)
The page you are viewing does not exist in version 21.2. This link will take you to the root page.
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

Custom SQL Query in the Report Designer

  • 2 minutes to read

This document describes how to allow users to edit SQL query text in the End-User Report Designer‘s Data Source Wizard.

Important

For security reasons, do not allow users to edit SQL queries if there is a chance that untrusted parties can access your reporting application. Refer to the following topic for more information: Data Access Security.

How to Enable Custom SQL

Specify the ReportDesigner component’s EnableCustomSql property to allow users to edit SQL queries:

<dxrud:ReportDesigner Name="reportDesigner">  
    <dxrud:ReportDesigner.DataSourceWizardSettings>  
        <dxda:DataSourceWizardSettings SqlWizardSettings="{dxda:SqlWizardSettings EnableCustomSql=True}" />  
    </dxrud:ReportDesigner.DataSourceWizardSettings>  
</dxrud:ReportDesigner>

Edit SQL in the Data Source Wizard

  1. Load a report in the Report Designer or create a new report bound to an SQL data source. In the Report Explorer window, select Manage Queries:

  2. In the Manage Queries window, click the ellipsis button to edit the selected query:

  3. You can edit the query in the invoked Query Editor window:

  4. If you enter a non-select query, the following error is displayed when you click Next:

Edit SQL in the Query Builder

Invoke the Data Source Wizard and navigate to the query creation page. On this page, click the Queries category’s plus button to create a new query in the Query Builder.

The Allow Edit SQL option is now available in the Query Builder. If a user switches to this mode, the visual features of the Query Builder are disabled in favor of the specified SQL string value.