-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOlapDataSourceConfigurator.cs
25 lines (21 loc) · 1.26 KB
/
OlapDataSourceConfigurator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using DevExpress.DataAccess.ConnectionParameters;
namespace MvcDashboardDataSources.Configuration {
public class OlapDataSourceConfigurator {
public static void ConfigureDataSource(DashboardConfigurator configurator, DataSourceInMemoryStorage storage) {
// Registers an OLAP data source.
DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource("OLAP Data Source", "olapConnection");
storage.RegisterDataSource("olapDataSource", olapDataSource.SaveToXml());
configurator.ConfigureDataConnection += Configurator_ConfigureDataConnection;
}
private static void Configurator_ConfigureDataConnection(object sender, ConfigureDataConnectionWebEventArgs e) {
if (e.ConnectionName == "olapConnection") {
OlapConnectionParameters olapParams = new OlapConnectionParameters();
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;"
+ "Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100;";
e.ConnectionParameters = olapParams;
}
}
}
}