UriJsonSource.Uri Property
Gets or sets the System.Uri object that points to a URI or text file with JSON data.
Namespace: DevExpress.DataAccess.Json
Assembly: DevExpress.DataAccess.v18.2.dll
Declaration
[DefaultValue(null)]
[TypeConverter("DevExpress.DataAccess.UI.Native.NoConvertableFromStringConverter,DevExpress.DataAccess.v18.2.UI")]
public Uri Uri { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Uri | *null* | Points to a Web-service endpoint or text file with JSON data. |
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(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "customers.json"));
jsonDataSource.JsonSource = new UriJsonSource(fileUri);
// Retrieve data from the JSON data source to the Report Designer's Field List
jsonDataSource.Fill();
return jsonDataSource;
}
See Also