ReportDesignerConfigurationBuilder.EnableCustomSql() Method

Enables editing custom SQL strings on the Create a Query or Select a Stored Procedure page of the SQL Data Source Wizard.

Namespace: DevExpress.AspNetCore.Reporting

Assembly: DevExpress.AspNetCore.Reporting.v18.1.dll

Syntax

public ReportDesignerConfigurationBuilder EnableCustomSql()

Returns

Type Description
ReportDesignerConfigurationBuilder

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

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().AddDefaultReportingControllers(); 

        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