public static JsonDataSource CreateReportDataSourceFromConnectionString() { JsonDataSource jsonDataSource = new DevExpress.DataAccess.Json.JsonDataSource() { // The application's configuration file should include the "JsonConnection" connection string ConnectionName = "JsonConnection" }; return(jsonDataSource); }
public static JsonDataSource CreateReportDataSourceWithAuthenticationInCode() { // Create a new UriJsonSource object and configure authentication data in it var jsonSource = new DevExpress.DataAccess.Json.UriJsonSource(); jsonSource.Uri = new Uri(@"http://northwind.servicestack.net/customers.json"); jsonSource.AuthenticationInfo.Username = "******"; jsonSource.AuthenticationInfo.Password = "******"; jsonSource.HeaderParameters.Add(new HeaderParameter("MyAuthHeader1", "secretToken1")); jsonSource.HeaderParameters.Add(new HeaderParameter("MyAuthHeader2", "secretToken2")); jsonSource.QueryParameters.Add(new QueryParameter("id", "123456")); jsonSource.QueryParameters.Add(new QueryParameter("name", "MyName")); // Create a JsonDataSource object and assign the UriJsonSource object to it var jsonDataSource = new DevExpress.DataAccess.Json.JsonDataSource() { JsonSource = jsonSource }; return(jsonDataSource); }