-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOlapDataSourceConfigurator.vb
24 lines (20 loc) · 1.16 KB
/
OlapDataSourceConfigurator.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWeb
Imports DevExpress.DataAccess.ConnectionParameters
Namespace MvcDashboardDataSources.Configuration
Public Class OlapDataSourceConfigurator
Public Shared Sub ConfigureDataSource(ByVal configurator As DashboardConfigurator, ByVal storage As DataSourceInMemoryStorage)
' Registers an OLAP data source.
Dim olapDataSource As New DashboardOlapDataSource("OLAP Data Source", "olapConnection")
storage.RegisterDataSource("olapDataSource", olapDataSource.SaveToXml())
AddHandler configurator.ConfigureDataConnection, AddressOf Configurator_ConfigureDataConnection
End Sub
Private Shared Sub Configurator_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
If e.ConnectionName = "olapConnection" Then
Dim olapParams As 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
End If
End Sub
End Class
End Namespace