ReportDesignerConfigurationBuilder.RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvider() Method
Registers the built-in MongoDB connection strings provider. This enables the Web Report Designer to retrieve MongoDB connection strings from the application configuration file.
Namespace: DevExpress.AspNetCore.Reporting
Assembly: DevExpress.AspNetCore.Reporting.v25.1.dll
NuGet Package: DevExpress.AspNetCore.Reporting
Declaration
public ReportDesignerConfigurationBuilder RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvider()
Returns
| Type | Description |
|---|---|
| ReportDesignerConfigurationBuilder | A ReportDesignerConfigurationBuilder that can be used to further configure the Report Designer services. |
Remarks
The Data Source Wizard and Report Wizard uses a connection strings provider to obtain data connections. Once a provider is registered, users can create new data sources based on registered MongoDB connection strings.
To allow users to create MongoDB data sources in ASP.NET Core applications, do the following:
- Install the MongoDB.Driver NuGet package.
- Add MongoDB connection strings (for example,
mongodb://...ormongodb+srv://...) to the application’s configuration file (appsettings.json). Call the
RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvidermethod in the ConfigureReportDesigner() builder to register the default MongoDB connection strings provider:using DevExpress.AspNetCore; using DevExpress.AspNetCore.Reporting; using DevExpress.DataAccess.Web; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; var builder = WebApplication.CreateBuilder(args); builder.Services.ConfigureReportingServices(configurator => { configurator.ConfigureReportDesigner(designerConfigurator => { designerConfigurator.RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvider(); }); }); var app = builder.Build();
You can also implement a custom connection string provider for MongoDB. For more information, refer to the following section in the Register MongoDB Data Connections topic: Implement a Custom Connection String Provider.