| |
 |
How to: Bind a PivotGridControl to an OLAP Cube via XMLA
The following example demonstrates how to bind a PivotGridControl to an OLAP cube via the XMLA data access standard.
In this example, the PivotGridControl.OLAPDataProvider property is used to specify that the Pivot Grid Control should use the XMLA data access standard to bind to an OLAP cube. OLAP connection parameters are specified in a connection string passed to the PivotGridControl.OLAPConnectionString property. The following parameters are provided:
- Data Source - a path to a data pump.
- Initial Catalog - a data catalog that contains cubes.
- Cube Name - the name of the cube that provides OLAP data.
Form1.cs |
using System;
using System.Windows.Forms;
using DevExpress.XtraPivotGrid;
namespace XtraPivotGrid_XMLA {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
void Form1_Load(object sender, EventArgs e) {
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Xmla;
pivotGridControl1.OLAPConnectionString =
"Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" +
"Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works";
}
}
}
|
Form1.vb |
Imports Microsoft.VisualBasic
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraPivotGrid
Namespace XtraPivotGrid_XMLA
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Specifies that PivotGridControl should use the XMLA data access standard
' to bind to an OLAP cube.
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Xmla
' Configures a data connection.
' Specifies a string that encapsulates connection parameters
' required to access the desired OLAP cube.
pivotGridControl1.OLAPConnectionString = _
"Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" & _
"Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works"
End Sub
End Class
End Namespace
|
Is this topic helpful?
Additional Feedback
Close
|