Back to Devexpress

IJsonSourceCustomizationService Interface

corelibraries-devexpress-dot-dataaccess-dot-json-b846c38e.md

latest2.4 KB
Original Source

IJsonSourceCustomizationService Interface

Allows you to specify a new JSON source for a JSON data source at runtime.

Namespace : DevExpress.DataAccess.Json

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public interface IJsonSourceCustomizationService
vb
Public Interface IJsonSourceCustomizationService

Remarks

DevExpress Reporting

If the JSON data source is already registered in the End-User Report Designer, you cannot change the JsonSource data source property to load data from another endpoint. This is because the data may already be loaded and cached. To specify a new JSON source, implement the IJsonSourceCustomizationService interface, as the following code snippet shows:

csharp
using DevExpress.DataAccess.Json;
using DevExpress.XtraPrinting.Native;
// ...
XtraReport1 report = new XtraReport1();
report.ReplaceService<IJsonSourceCustomizationService>(new MyJsonCustomizationService()); 
report.CreateDocument();
// ...
public class MyJsonCustomizationService : IJsonSourceCustomizationService  
{  
    public JsonSourceBase CustomizeJsonSource(JsonDataSource jsonDataSource)  
    {  
        return new DevExpress.DataAccess.Json.UriJsonSource("https://northwind.netcore.io/customers.json"));  
    }  
}

For more information, review the following help topic: Data Sources in Web End-User Report Designer (ASP.NET Core).

See Also

IJsonSourceCustomizationService Members

DevExpress.DataAccess.Json Namespace