dashboard-113908-winforms-dashboard-winforms-designer-create-dashboards-in-the-winforms-designer-providing-data-olap-data-source-connecting-to-olap-cubes.md
The Dashboard Designer has the capability to connect to an OLAP cube in the Microsoft Analysis Services database using the Data Source wizard or in code. You can either allow end users to manually specify connection parameters or supply a set of predefined OLAP data connections.
To connect to an OLAP cube in the Dashboard Designer, follow the steps below.
Click the New Data Source button in the Data Source ribbon tab.
On the first page of the invoked Data Source Wizard dialog, specify whether you want to use an existing data connection or create a new data connection.
On the next page, select Olap and click Next.
On the next page, choose the required Connection type. The following types are available:
If you select Server , the following options are available:
Server name
UserId
Password
Catalog
Cube Name
Click Finish to create a data source.
If you select Local cube file , specify the path to the required OLAP cube. To locate the cube, click the ellipsis button next to the Database field.
Click Finish to create a data source.
If you select Custom connection string , specify a connection string in the Custom connection string editor.
Click Finish to create a data source.
To create a data source that uses a connection to an OLAP cube, create a DashboardOlapDataSource class instance and perform these steps.
Create an OlapConnectionParameters class object and specify the DashboardOlapDataSource.ConnectionString property.
Add the created DashboardOlapDataSource object to the Dashboard.DataSources collection.
The following code snippet shows how to supply the dashboard with data from the Adventure Works cube deployed on the OLAP server.
using DevExpress.DashboardCommon;
using DevExpress.DataAccess.ConnectionParameters;
// ...
OlapConnectionParameters olapParams = new OlapConnectionParameters();
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=localhost;Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100";
DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource(olapParams);
dashboard.DataSources.Add(olapDataSource);
Imports DevExpress.DashboardCommon
Imports DevExpress.DataAccess.ConnectionParameters
' ...
Dim olapParams As New OlapConnectionParameters()
olapParams.ConnectionString = "Provider=MSOLAP;Data Source=localhost;Initial catalog=Adventure Works DW Standard Edition;Cube name=Adventure Works;Query Timeout=100"
Dim olapDataSource As New DashboardOlapDataSource(olapParams)
dashboard.DataSources.Add(olapDataSource)
See Also