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

ReportDesignerConfigurationBuilder.RegisterDataSourceWizardConnectionStringsProvider<T>(Boolean) Method

Registers a custom connection string provider that specifies the data connections to be available for an end-user within the SQL Data Source Wizard.

Namespace: DevExpress.AspNetCore.Reporting

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

Declaration

public ReportDesignerConfigurationBuilder RegisterDataSourceWizardConnectionStringsProvider<T>(
    bool overrideWebConfigConnections
)
    where T : class, IDataSourceWizardConnectionStringsProvider, new()
Public Function RegisterDataSourceWizardConnectionStringsProvider(Of T As {Class, IDataSourceWizardConnectionStringsProvider, New})(
    overrideWebConfigConnections As Boolean
) As ReportDesignerConfigurationBuilder

Parameters

Name Type Description
overrideWebConfigConnections Boolean

If true, only the connection name is serialized with the report definition. If false, data connection parameters are serialized with the report data source when the report is passed to the client.

Returns

Type Description
ReportDesignerConfigurationBuilder

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

Type Parameters

Name Description
T

A custom connection string provider that implements the IDataSourceWizardConnectionStringsProvider interface.

Remarks

A connection string provider defines which data connections are available in the Web Report Designer. To define a custom provider, implement the IDataSourceWizardConnectionStringsProvider interface. To use the custom provider in your application, register it using the RegisterDataSourceWizardConnectionStringsProvider method, passing the provider as a typed parameter.

using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Native;
using DevExpress.DataAccess.Web;
using System.Collections.Generic;
// ... 

public class MyDataSourceWizardConnectionStringsProvider : IDataSourceWizardConnectionStringsProvider {
    public Dictionary<string, string> GetConnectionDescriptions() {

    }

    public DataConnectionParametersBase GetDataConnectionParameters(string name) {

    }
}

In the code above, the RegisterDataSourceWizardConnectionStringsProvider method is called with true passed as a parameter. In this instance, only the connection name is serialized with the report definition (no data connection parameters will ever be saved along with report layouts, providing proper data connection security). When generating a report for the Web Document Viewer or the Report Designer's Preview, connection parameters will be requested from the custom connection string provider, instead of the predefined one, which gets connection information from the appsettings.json file.

If you pass false as the RegisterDataSourceWizardConnectionStringsProvider method parameter, data connection parameters are serialized with the report data source when the report is passed to the client. These parameters are encrypted by the default ASP.NET Core data protection service. You can also implement the ISecureDataConverter interface to provide a custom data protection mechanism.

Note

Use the RegisterDataSourceWizardConfigFileConnectionStringsProvider() method, to register a predefined connection string provider. In this instance, the connection strings specified in the project's appsettings.json file are enlisted in the SQL Data Source Wizard.

See Also