-
Notifications
You must be signed in to change notification settings - Fork 0
/
OlapDashboard.aspx.vb
35 lines (31 loc) · 2.12 KB
/
OlapDashboard.aspx.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
25
26
27
28
29
30
31
32
33
34
35
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardWeb
Imports DevExpress.DataAccess.ConnectionParameters
Imports System
Namespace WebFormsDashboardDataSources.Pages
Public Partial Class OlapDashboard
Inherits Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim dashboardFileStorage As DashboardFileStorage = New DashboardFileStorage("~/App_Data/Dashboards")
ASPxDashboardOlap.SetDashboardStorage(dashboardFileStorage)
' Uncomment the next line to allow users to create new data sources based on predefined connection strings.
'ASPxDashboardOlap.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());
' Create a data source storage.
Dim dataSourceStorage As DataSourceInMemoryStorage = New DataSourceInMemoryStorage()
' Register an OLAP data source.
Dim olapDataSource As DashboardOlapDataSource = New DashboardOlapDataSource("OLAP Data Source", "olapConnection")
dataSourceStorage.RegisterDataSource("olapDataSource", olapDataSource.SaveToXml())
' Set the configured data source storage.
ASPxDashboardOlap.SetDataSourceStorage(dataSourceStorage)
AddHandler ASPxDashboardOlap.ConfigureDataConnection, AddressOf Me.ASPxDashboardOlap_ConfigureDataConnection
ASPxDashboardOlap.InitialDashboardId = "dashboardOlap"
End Sub
Private Sub ASPxDashboardOlap_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
If Equals(e.ConnectionName, "olapConnection") Then
Dim olapParams As OlapConnectionParameters = 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