wpf-10360-controls-and-libraries-pivot-grid-getting-started-net-framework-lesson-2-bind-a-pivot-grid-to-an-olap-cube.md
A cube is a multidimensional structure defined by its measures and dimensions. You can think of a measure as a data field in PivotGridControl, while a dimension can be represented by a column field or a 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.
Note
This tutorial is based on the .NET Framework. For the .NET tutorial, refer to the following topic: Bind a Pivot Grid to an OLAP Cube (.NET)
Documentation: Migrate WPF Applications to .NET
To display data from an OLAP cube, do the following.
Run MS Visual Studio. Create a new WPF Application project and add PivotGridControl as you did in Lesson 1.
Click the smart tag icon ( ) displayed at the top-right of the pivot grid to invoke the Pivot Grid Control Tasks popup window.
In the invoked wizard, select OLAP Cube technology and click Next.
Select the ADOMD.NET as a data provider and click Next.
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.
Click the pivot grid’s smart tag and use the Add Data Area Field menu item to add a new field to the Data Header Area. In a similar manner, add two fields both to the Column Header and Row Header areas.
To associate created fields with OLAP measures/dimensions, click the field’s smart tag icon. In the invoked menu, click the FieldName property ellipsis button to see existing data source fields.
Run the project and see the result.
See Also