windowsforms-3253-controls-and-libraries-pivot-grid-binding-to-data-olap-mode-binding-to-olap-data-sources.md
The PivotGridControl allows you to visualize data contained in a cube deployed on an OLAP server. In OLAP mode, the PivotGridControl delegates data management operations (such as summarization, grouping, etc.) to the server side. Thus, you can use OLAP binding mode to process large amounts of data.
For information about requirements and limitations imposed by binding to OLAP data sources, see OLAP Requirements and Limitations.
You can bind the Pivot Grid to an OLAP cube at design time in two ways:
To bind to an OLAP cube in the Data Source Configuration Wizard, do the following:
Click the Data Source Button.
In the invoked Data Source Configuration Wizard, select OLAP Cube.
Select the provider used to communicate with the Microsoft Analysis Services server.
On the final page, specify the required settings.
Rebuild the solution, click the control’s smart tag, and make sure that the Pivot Grid is bound to the OLAP cube.
The Connection String Editor dialog allows you to modify the OLAP connection string at design time.
You can invoke this dialog from the control’s smart tag menu or by clicking the ellipsis button next to the PivotGridControl.OLAPConnectionString property in the standard Properties window.
Note
To display all settings available in the Connection String Editor, enable the Show Advanced Properties checkbox.
This dialog contains the same settings as the Data Source Configuration Wizard. Moreover, it contains the following settings:
After you create an OLAP data source at design time, you can create Pivot Grid fields. To do this, open the Fields Page of the control’s Designer. The Field List pane contains all available measures and dimension levels of the cube. To add a specific measure/dimension level to the Pivot Grid, drag the measure or dimension onto the PivotGrid Fields pane.
Tip
Demo : OLAP Browser module in the XtraPivotGrid MainDemo
Requires installation of WinForms Subscription. Download.
This example demonstrates how to specify connection settings to the Adventure Works cube on the OLAP server.
Follow the steps below to bind the Pivot Grid control to an OLAP cube in code.
View Example: How to Connect a Pivot Grid to an OLAP Data Source
using DevExpress.XtraPivotGrid;
using DevExpress.XtraPivotGrid.Customization;
namespace WinOlapRetrieveFieldsExample {
public partial class Form1 : DevExpress.XtraEditors.XtraForm {
public Form1() {
InitializeComponent();
// Specify the OLAP connection settings.
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd;
pivotGridControl1.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;";
// ...
}
// ...
}
}
Imports DevExpress.XtraPivotGrid
Imports DevExpress.XtraPivotGrid.Customization
Namespace WinOlapRetrieveFieldsExample
Public Partial Class Form1
Inherits DevExpress.XtraEditors.XtraForm
Public Sub New()
InitializeComponent()
' Specify the OLAP connection settings.
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd
pivotGridControl1.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;"
' ...
End Sub
' ...
End Class
End Namespace
View Example: How to Bind to an OLAP Cube with the ADOMD.NET Data ProviderView Example: How to Bind to an OLAP Cube with the XMLA Data Provider