@@ -40,7 +40,7 @@ public void ConfigureServices(IServiceCollection services) {
40
40
configurator . SetDashboardStorage ( dashboardFileStorage ) ;
41
41
DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage ( ) ;
42
42
43
- DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource ( "SQL Data Source " , "NWindConnectionString" ) ;
43
+ DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource ( "Sales Person " , "NWindConnectionString" ) ;
44
44
sqlDataSource . DataProcessingMode = DataProcessingMode . Client ;
45
45
SelectQuery query = SelectQueryFluentBuilder
46
46
. AddTable ( "Categories" )
@@ -51,7 +51,7 @@ public void ConfigureServices(IServiceCollection services) {
51
51
dataSourceStorage . RegisterDataSource ( "sqlDataSource" , sqlDataSource . SaveToXml ( ) ) ;
52
52
53
53
DashboardExcelDataSource energyStatistics = new DashboardExcelDataSource ( "Energy Statistics" ) ;
54
- energyStatistics . FileName = FileProvider . GetFileInfo ( "Data/EnergyStatistics.xls" ) . PhysicalPath ;
54
+ energyStatistics . ConnectionName = "energyStatisticsDataConnection" ;
55
55
energyStatistics . SourceOptions = new ExcelSourceOptions ( new ExcelWorksheetSettings ( "Map Data" ) ) ;
56
56
dataSourceStorage . RegisterDataSource ( "energyStatisticsDataSource" , energyStatistics . SaveToXml ( ) ) ;
57
57
@@ -68,16 +68,10 @@ public void ConfigureServices(IServiceCollection services) {
68
68
}
69
69
70
70
private void Configurator_ConfigureDataConnection ( object sender , ConfigureDataConnectionWebEventArgs e ) {
71
- if ( e . DataSourceName . Contains ( "Departments" ) ) {
72
- Uri fileUri = new Uri ( FileProvider . GetFileInfo ( "Data/Departments.json" ) . PhysicalPath , UriKind . RelativeOrAbsolute ) ;
73
- JsonSourceConnectionParameters jsonParams = new JsonSourceConnectionParameters ( ) ;
74
- jsonParams . JsonSource = new UriJsonSource ( fileUri ) ;
75
- e . ConnectionParameters = jsonParams ;
76
- }
77
71
if ( e . DataSourceName == "Departments" ) {
78
72
e . ConnectionParameters = new XmlFileConnectionParameters ( ) { FileName = FileProvider . GetFileInfo ( "Data/Departments.xml" ) . PhysicalPath } ;
79
73
}
80
- if ( e . DataSourceName == "Energy Statistics " ) {
74
+ if ( e . ConnectionName == "energyStatisticsDataConnection " ) {
81
75
e . ConnectionParameters = new ExcelDataSourceConnectionParameters ( FileProvider . GetFileInfo ( "Data/EnergyStatistics.xls" ) . PhysicalPath ) ;
82
76
}
83
77
}
0 commit comments