Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Collapse]Pivot Grid
   [Collapse]Getting Started
     Lesson 1 - Bind a Pivot Grid to an MDB Database
     Lesson 2 - Bind a Pivot Grid to an OLAP Cube
     Tutorial Videos
     Included Components
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Appearance
   [Expand]Design-time Features
   [Expand]Miscellaneous
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Lesson 2 - Bind a Pivot Grid to an OLAP Cube

A cube is a multidimensional structure defined by its measures and dimensions. You can think of a measure as a data field in the PivotGridControl, while a dimension can be represented by a column, filter, or row field. This tutorial will help you learn how to bind a pivot grid to an existing OLAP (OnLine Analytical Processing) cube. In this example, we will use the Adventure Works cube.

To display data from an OLAP cube, do the following.

  1. Run MS Visual Studio. Create a new Windows Forms Application project and add the PivotGridControl as you did in Lesson 1, Steps 1-4.
  2. Click the smart tag icon () displayed at the top-right of the pivot grid to invoke the popup PivotGridControl Tasks window.

    In this window, select the Data Source Wizard item.

  3. In the invoked wizard, select the OLAP Cube technology and click Next.

  4. Select ADOMD.NET as a data provider and click Next.

  5. In the next window, select the MSOLAP provider and specify the Server Name as https://demos.devexpress.com/Services/OLAP/msmdpump.dll. Then, click the Retrieve Schema button.

    Make sure that the following parameters are specified.

    Provider MSOLAP Identifies the data provider to be used. The "MSOLAP" string identifies the latest version of the OLE DB provider.
    Server Name https://demos.devexpress.com/Services/OLAP/msmdpump.dll Specifies either the name of a server that runs an instance of Microsoft SQL Server Analysis Services (SSAS), the path to a cube file, or the path to a data pump.
    Catalog Name Adventure Works DW Standard Edition Specifies a data catalog that contains cubes.
    Cube Name Adventure Works Specifies the name of a cube that provides OLAP data.

    The image below demonstrates configured settings of the OLAP connection. Click Finish to close the wizard.

  6. In PivotGridControl, create fields that represent specific measures and dimension levels of the cube.

    Click the smart tag icon and then click Run Designer... in the popup window.

  7. In the invoked PivotGrid Designer, add five fields using the button and specify their FieldName, Area, and AreaIndex properties as shown below.

    FieldName

    Area

    AreaIndex

    [Customer].[Country].[Country] RowArea 0
    [Customer].[City].[City] RowArea 1
    [Date].[Fiscal].[Fiscal Year] ColumnArea 0
    [Date].[Fiscal].[Fiscal Quarter] ColumnArea 1
    [Measures].[Internet Sales Amount] DataArea 0

    The image below shows the result.

  8. Close the designer. The pivot grid fields should be arranged as illustrated below.

Expanded Result

Run the project to see the result.

How would you rate this topic?​​​​​​​