ReportDesignerConfigurationBuilder.EnableCustomSql() Method
Enables editing custom SQL strings in the Data Source Wizard.
Namespace: DevExpress.AspNetCore.Reporting
Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
Returns
Type | Description |
---|---|
ReportDesignerConfigurationBuilder | A ReportDesignerConfigurationBuilder that can be used to further configure the Report Designer services. |
Remarks
The following code shows how to enable custom SQL editing in the application startup file.
using DevExpress.AspNetCore;
using DevExpress.AspNetCore.Reporting;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDevExpressControls();
builder.Services.AddMvc();
builder.Services.ConfigureReportingServices(configurator => {
configurator.ConfigureReportDesigner(designerConfigurator => {
designerConfigurator.EnableCustomSql();
});
});
var app = builder.Build();
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.