DefaultReportDesignerContainer.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.XtraReports.Web.ReportDesigner
Assembly: DevExpress.XtraReports.v25.1.Web.dll
NuGet Package: DevExpress.Web.Reporting.Common
Declaration
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 MVC and ASP.NET Web Forma 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 (Web.config). Call the
RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvidermethod at application startup to register the default MongoDB connection strings provider:using DevExpress.XtraReports.Web.ReportDesigner; // ... public class Global : System.Web.HttpApplication { void Application_Start(object sender, EventArgs e) { // ... DefaultReportDesignerContainer.RegisterDataSourceWizardConfigFileMongoDBConnectionStringsProvider(); // ... } // ... }
You can also implement a custom connection string provider for MongoDB. For more information, refer to the following topics:
- Implement a Custom Connection String Provider (ASP.NET MVC)
- Implement a Custom Connection String Provider (ASP.NET Web Forms).