Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

JSON Data - Change Data Source at Runtime

When a JSON data source is already registered in the End-User Report Designer in ASP.NET Core Applications, you cannot change the data source’s JsonSource property to load data from another endpoint: the data may already be loaded and cached. To specify a new JSON source, implement the IJsonSourceCustomizationService interface.

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"));  
    }  
}