Back to Devexpress

Register JSON Data Connections (ASP.NET Core)

xtrareports-401655-web-reporting-asp-net-core-reporting-end-user-report-designer-in-asp-net-applications-use-data-sources-and-connections-json-data-register-connections.md

latest4.0 KB
Original Source

Register JSON Data Connections (ASP.NET Core)

  • Nov 07, 2025
  • 4 minutes to read

This document describes how to provide JSON data connections to the Web Report Designer. The Data Source Wizard displays these connections when users create new JSON data sources.

The Data Source Wizard allows you to create a new JSON data source if a JSON data connection provider is registered in the application. You can register a built-in connection provider or implement and register a custom provider:

Built-in connection providerThe provider obtains connections from the application’s configuration file (appsettings.json).Custom connection providerThe provider allows you to create connection strings at runtime and use custom storage to store/load connection strings and credentials.

Use the Application Configuration File

Follow the steps below to use connection strings from the application configuration file:

  1. Add data connections to the application’s configuration file (appsettings.json).

  2. Register the built-in connection string provider. Call the static ReportDesignerConfigurationBuilder.RegisterDataSourceWizardConfigFileJsonConnectionStringsProvider method at application startup.

If you use data connections from appsettings.json, you cannot use a custom connection string provider described in the next section.

Implement a Custom Connection String Provider

A custom connection provider allows you to manage JSON connections that are accessible to users:

  • Modify connections at runtime (for example, depending on a user)
  • Allow users to create new connections
  • Validate connections and keep them in a separate storage
  • Store credentials securely

Tip

To review a sample JSON connection provider and storage implementation, use DevExpress templates to create an ASP.NET Core Reporting application. When creating the project, enable the Add Sample JSON Data Connection Storage option. Refer to the following help topic for more information: Use DevExpress Visual Studio Templates to Create an ASP.NET Core Reporting App with a Report Designer.

To use a custom JSON connection provider, follow the steps below:

  1. Create a class that implements the IDataSourceWizardJsonConnectionStorage interface. The implementation below stores connections in a session.

  2. Create a new class (CustomJsonDataConnectionProviderFactory in this example) that implements the IJsonDataConnectionProviderFactory interface.

  3. Register services at application startup:

After you register a custom JSON connection provider, you can do the following:

  • Use an existing connection to create a new JSON data source:

  • Create a new JSON connection:

See Also

SQL Database - Customize the Schema

Register Predefined Data Sources (ASP.NET Core)

Bind Reports to Data - JSON Data