UriJsonSource Class
Associates a JsonDataSource object with JSON data retrieved from a web service endpoint or a text file.
Namespace: DevExpress.DataAccess.Json
Assembly: DevExpress.DataAccess.v19.1.dll
Declaration
Remarks
The following example demonstrates how to associate the JsonDataSource object with data from a web-service endpoint.
using DevExpress.DataAccess.Json;
using DevExpress.XtraReports.UI;
// ...
public static JsonDataSource CreateDataSourceFromWeb() {
var jsonDataSource = new JsonDataSource();
// Specify the data source location
jsonDataSource.JsonSource = new UriJsonSource(new Uri("http://northwind.servicestack.net/customers.json"));
// Retrieve data from the JSON data source to the Report Designer's Field List
jsonDataSource.Fill();
return jsonDataSource;
}
The following example demonstrates how to associate the JsonDataSource object with JSON data from a file.
using DevExpress.DataAccess.Json;
using DevExpress.XtraReports.UI;
// ...
public static JsonDataSource CreateDataSourceFromFile() {
var jsonDataSource = new JsonDataSource();
// Specify the a JSON file's name
Uri fileUri = new Uri("customers.json", UriKind.RelativeOrAbsolute);
jsonDataSource.JsonSource = new UriJsonSource(fileUri);
// Retrieve data from the JSON data source to the Report Designer's Field List
jsonDataSource.Fill();
return jsonDataSource;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the UriJsonSource class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.