DefaultReportDesignerContainer.RegisterDataSourceWizardJsonConnectionStorage<T>(Boolean) Method
Registers a custom service that stores and provides JSON connections.
Namespace: DevExpress.XtraReports.Web.ReportDesigner
Assembly: DevExpress.XtraReports.v24.1.Web.dll
NuGet Package: DevExpress.Web.Reporting.Common
Declaration
public static void RegisterDataSourceWizardJsonConnectionStorage<T>(
bool overrideWebConfigConnections
)
where T : IDataSourceWizardJsonConnectionStorage
Parameters
Name | Type | Description |
---|---|---|
overrideWebConfigConnections | Boolean | True to use the DevExpress.DataAccess.Web.IJsonDataConnectionProviderFactory interface implemented in the storage; otherwise, use the DevExpress.DataAccess.Web.IJsonDataConnectionProviderFactory interface implemented in the viewer. |
Type Parameters
Name | Description |
---|---|
T | The type of the class that implements the DevExpress.DataAccess.Web.IDataSourceWizardJsonConnectionStorage interface. |
Remarks
The connection storage receives, stores and provides JSON connection strings on demand.
The following code in the ASP.NET Reporting Demo registers services at the application startup:
using DevExpress.DataAccess.Web;
using DevExpress.XtraReports.Web.Extensions;
using DevExpress.XtraReports.Web.QueryBuilder;
using DevExpress.XtraReports.Web.QueryBuilder.Native;
using DevExpress.XtraReports.Web.ReportDesigner;
using DevExpress.XtraReports.Web.ReportDesigner.Native;
using DevExpress.XtraReports.Web.WebDocumentViewer;
using DevExpress.XtraReports.Web.WebDocumentViewer.Native;
using System;
using System.Web.SessionState;
namespace WebApplication1
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
ReportDesignerBootstrapper.SessionState = SessionStateBehavior.Required;
WebDocumentViewerBootstrapper.SessionState = SessionStateBehavior.Required;
QueryBuilderBootstrapper.SessionState = SessionStateBehavior.Required;
// ...
DefaultReportDesignerContainer.RegisterDataSourceWizardConfigFileJsonConnectionStringsProvider();
DefaultReportDesignerContainer.RegisterDataSourceWizardJsonConnectionStorage<CustomDataSourceWizardJsonDataConnectionStorage>(true);
DefaultWebDocumentViewerContainer.Register<IJsonDataConnectionProviderFactory, CustomJsonDataConnectionProviderFactory>();
DefaultQueryBuilderContainer.Register<IJsonDataConnectionProviderFactory, CustomJsonDataConnectionProviderFactory>();
// ...
}
// ...
}
}
A user specifies credentials in the JSON Data Wizard to connect to the JSON data source. When the Wizard is finished, credentials are encrypted and saved. A malicious user can specify various credentials and analyze the encrypted result in an attempt to find the cryptographic key. The connection storage prevents a malicious user from accessing the encrypted credentials used in the data source connection string.