The requested page is not available for the requested platform. You are viewing the content for Default platform.

ReportDesignerConfigurationBuilder.RegisterDataSourceWizardConfigFileConnectionStringsProvider() Method

Registers the predefined connection string provider that enables the Web Report Designer to use connection strings specified in the project's appsettings.json file.

Namespace: DevExpress.AspNetCore.Reporting

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

Declaration

public ReportDesignerConfigurationBuilder RegisterDataSourceWizardConfigFileConnectionStringsProvider()
Public Function RegisterDataSourceWizardConfigFileConnectionStringsProvider As ReportDesignerConfigurationBuilder

Returns

Type Description
ReportDesignerConfigurationBuilder

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

Remarks

To allow end-users to create new data sources in the Web Report Designer, you should register connection strings explicitly. The SQL Data Source Wizard displays these connections.

The default connection string provider implementation searches the appsettings.json file in the current directory and reads connection strings from the file’s ConnectionStrings section. To enable the Report Designer to use this provider, call the static RegisterDataSourceWizardConfigFileConnectionStringsProvider method at the application's startup.

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.RegisterDataSourceWizardConfigFileConnectionStringsProvider();
            });
        });        
    }
//...    
}

You can also use the static DefaultConnectionStringProvider.AssignConnectionStrings method to override the default connection string provider. For instance, this method allows you to get connection strings from a set of different configuration sources, such as appsettings.Development.json, connectionStrings.json, in-memory collection, etc.

See Register Data Connections for more information.

Important

When the SQL Data Source wizard obtains connection strings from the appsettings.json file, only the connection names are serialized with the report definition. This provides data connection security. You can also allow passing connection parameters to the client.

See Also