Skip to main content
A newer version of this page is available. .

ReportDesignerConfigurationBuilder.EnableCustomSql() Method

Enables editing custom SQL strings in the Data Source Wizard.

Namespace: DevExpress.AspNetCore.Reporting

Assembly: DevExpress.AspNetCore.Reporting.v20.2.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public ReportDesignerConfigurationBuilder EnableCustomSql()

Returns

Type Description
ReportDesignerConfigurationBuilder

A ReportDesignerConfigurationBuilder that can be used to further configure the Report Designer services.

Remarks

The following code demonstrates how to enable custom SQL editing.

using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
//... 

public class Startup {
//... 
    public void ConfigureServices(IServiceCollection services) {
        services.AddDevExpressControls();
        services.AddMvc(); 

        services.ConfigureReportingServices(configurator => {
            configurator.ConfigureReportDesigner(designerConfigurator => {
                designerConfigurator.EnableCustomSql();
            });
        });        
    }
//...    
}

With the code above, the Custom SQL Editor can be invoked on the Create a Query or Select a Stored Procedure page of the SQL Data Source Wizard.

Important

Custom SQL queries are validated before their execution. Although the default validation mechanism only allows custom queries containing SELECT statements (except for SELECT INTO clauses), it cannot be considered safe as it does not prevent execution of potentially harmful requests. For this reason, we strongly recommend that you implement your own validation logic that does not reduce the default restrictions and permits only execution of specific query kinds. To provide a custom validation logic, register a custom service using the RegisterSqlDataSourceWizardCustomizationService<T>() method.

See Also