Connecting to OLAP Cubes

The Dashboard Designer provides 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 provide a set of predefined OLAP data connections.

To connect to an OLAP cube in the Dashboard Designer, do these steps.

  1. Click the New Data Source button in the Data Source ribbon tab.

    DataBinding_NewDataSource

  2. On the first page of the invoked Data Source Wizard dialog, select Olap and click Next.

    DataSourceWizard_DataSourceType_Olap

  3. On the next page, choose the required Connection type. The following types are available.

Server

If you selected Server, the following options are available:

DataSourceWizard_OlapServer

  • Server name

    Specify the name of the OLAP server to which the connection should be established.

  • UserId

    Specify the user name used to authenticate to the OLAP server.

  • Password

    Specify the password used to authenticate to the OLAP server.

  • Catalog

    Select a data catalog that contains cubes.

  • Cube Name

    Select a cube that provides OLAP data.

Click Finish to create a data source.

Local Cube File

If you selected the Local cube file, specify the path to the requiredOLAP cube. To locate the cube, click the ellipsis button next to the Database field.

DataSourceWizard_OlapLocalFile

Click Finish to create a data source.

Custom Connection String

If you selected Custom connection string, specify a connection string in the Custom connection string editor.

DataSourceWizard_CustomString

Click Finish to create a data source.

Creating a Data Source in Code

To create a data source that uses a connection to an OLAP cube, create a DashboardOlapDataSource class instance and perform these steps.

  1. Create an OlapConnectionParameters class object and specify the DashboardOlapDataSource.ConnectionString property.

    Pass the resulting OlapConnectionParameters object to the DashboardOlapDataSource constructor.

    Note

    As an alternative, you can add a connection string with required parameters to the application configuration file. Then, assign the connection string name to the DashboardOlapDataSource.ConnectionName property.

  2. 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 = "Data Source=localhost;Catalog=Adventure Works DW Standard Edition;";

            DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource(olapParams);
            dashboard.DataSources.Add(olapDataSource);
See Also