CustomJsonSource Class
Associates a JsonDataSource object with data retrieved from a JSON object.
Namespace: DevExpress.DataAccess.Json
Assembly: DevExpress.DataAccess.v19.1.dll
Declaration
Remarks
The following example demonstrates how to provide the JsonDataSource object with data from a JSON object.
using DevExpress.DataAccess.Json;
using DevExpress.XtraReports.UI;
// ...
public static JsonDataSource CreateDataSourceFromText() {
var jsonDataSource = new JsonDataSource();
// Specify a string with JSON content
string json = "{\"Customers\":[{\"Id\":\"ALFKI\",\"CompanyName\":\"Alfreds Futterkiste\",\"ContactName\":\"Maria Anders\",\"ContactTitle\":\"Sales Representative\",\"Address\":\"Obere Str. 57\",\"City\":\"Berlin\",\"PostalCode\":\"12209\",\"Country\":\"Germany\",\"Phone\":\"030-0074321\",\"Fax\":\"030-0076545\"}],\"ResponseStatus\":{}}";
// Specify the object that retrieves JSON data
jsonDataSource.JsonSource = new CustomJsonSource(json);
// Retrieve data from the JSON data source to the Report Designer's Field List
jsonDataSource.Fill();
return jsonDataSource;
}
Inheritance
Object
JsonSourceBase
CustomJsonSource
See Also