[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Expand]Data Analysis
   [Expand]Data Formatting
   [Expand]Layout
   [Expand]Appearance
   [Expand]Data Export
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Collapse]Examples
    [Collapse]Binding to Data
      How to: Create and Bind a Pivot Grid to Data in Code
      How to: Bind a Pivot Grid to an OLAP Datasource
      How to: Add Unbound Fields
    [Expand]Data Shaping
    [Expand]Data Analysis
    [Expand]Data Formatting
    [Expand]Layout
    [Expand]Appearance
    [Expand]Data Export
    [Expand]Miscellaneous
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Bind a Pivot Grid to an OLAP Datasource

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T344653.

If you have a cube on the OLAP server (Microsoft Analysis Services), you can view its data using the ASPxPivotGrid control. In this example, you will see how to specify connection settings to the server and create fields that represent specific measures and dimensions of the cube.

To bind the Pivot Grid control to an OLAP cube, follow the steps below.

  • Set ADOMD as a data provider using the ASPxPivotGrid.OLAPDataProvider property.

  • Specify connection settings to the server using the ASPxPivotGrid.OLAPConnectionStrings property. The connection string used in the example is shown below.

    OlapConnectionString="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;"
  • Create fields for all the measures and dimension in the bound OLAP cube, and moves these fields to the specified area, hiding them. To do it, use the ASPxPivotGrid.RetrieveFields method overload and set the field's visibility to false.

  • Place some of the created fields within corresponding Pivot Grid Control areas and set the visibility of the fields to true, using the PivotGridFieldBase.Visible property.

Use the invoked Customization Form to specify the Pivot Grid control's layout.

To learn more about OLAP Datasources, see OLAP Datasources.

Is this topic helpful?​​​​​​​