Version

Using ADOMD

Topic Overview

Purpose

This topic explains and demonstrates the WinPivotGrid™ data binding using ADOMD data Source/Provider.

Application Requirements

Ensure that your application is created based on .Net Framework 4 , not .Net Framework 4 Client Profile that does not include System.Web.Extensions .

In this topic

This topic contains the following sections:

Using ADOMD

Preview

The following screenshot is the preview of the result from ADOMD data binding example in this topic:

Using ADOMD 1.png

Requirements

To complete the procedure you need the following:

Requirement category Requirement listing

Assemblies

Infragistics.Olap.Core.v22.2

Infragistics.Olap.DataSource.v22.2

Infragistics.Olap.DataProvider.Adomd.v22.2

Infragistics.Olap.DataSource.Mdx.v22.2

Infragistics.Shared.v22.2

Infragistics.Win.UltraWinPivotGrid.v22.2

Infragistics.Win.v22.2

Using/Imports

Add the following Using/Imports statement in your application form:

Infragistics.Olap.Adomd

ADOMD settings

ADOMD data provider requires a connection via ConnectionString property, in order to communicate with the data in the server.

The following table lists parameters that are necessary to establish a connection to the data in the server using the AdomdInitialSettings object. There are other optional parameters for authentication and security (not listed here). The binding code example below contains all these settings.

Parameter Description

provider

Used for connections that require SQL server data provider for Analysis Services ( Optional using current version). If specific version is required then this parameter needs to be specified.

"provider=MSOLAP.4;"

data source

Specifies the server instance ( Required ).

"data source=http://sampledata.infragistics.com/olap/msmdpump.dll;"

In addition to the connection string, mentioned above, you need to configure the following settings including the dimensions (rows, columns and measures) of the cube.

Parameter Description

catalog

Specifies the name of the Analysis Services database ( Required ).

Catalog = "Adventure Works DW Standard Edition"

cube

Cube name ( Required ).

Cube = "Adventure Works"

Rows

Rows dimensions.

Rows = "[Date].[Calendar]"

Columns

Column dimensions.

Columns = "[Product].[Category] "

Measures

Measures dimensions.

Measures = "[Measures].[Reseller Sales Amount]"

Code

ADOMD data provider communicates with Microsoft SQL Server Analysis Services using XML for analysis protocol. The following code example demonstrates how to configure the pivot grid to communicate with the data using ADOMD.

Note
Note:

This topic uses Infragistics sample data for demonstration purposes.

This example uses the data from the Infragistics OLAP server.

In C#:

AdomdInitialSettings settings = new AdomdInitialSettings();
StringBuilder sb = new StringBuilder();
sb.Append("provider=MSOLAP.4;");
sb.Append("data source=http://sampledata.infragistics.com/olap/msmdpump.dll;");
sb.Append("catalog=\"Adventure Works DW Standard Edition\";");
sb.Append("cube=\"Adventure Works\";");
options.ConnectionString = sb.ToString();
settings.Catalog = "Adventure Works DW Standard Edition";
settings.Cube = "Adventure Works";
settings.Rows = "[Date].[Calendar]";
settings.Columns = "[Product].[Category] ";
settings.Measures = "[Measures].[Reseller Sales Amount]";
AdomdDataSource adomdDs = new AdomdDataSource(settings);
ultraPivotGrid1.DataSource = adomdDs;

In Visual Basic:

Dim settings As New AdomdInitialSettings()
Dim sb As New StringBuilder()
sb.Append("provider=MSOLAP.4;")
sb.Append("data source=http://sampledata.infragistics.com/olap/msmdpump.dll;")
sb.Append("catalog=""Adventure Works DW Standard Edition"";")
sb.Append("cube=""Adventure Works"";")
settings.ConnectionString = sb.ToString()
settings.Catalog = "Adventure Works DW Standard Edition"
settings.Cube = "Adventure Works"
settings.Rows = "[Date].[Calendar]"
settings.Columns = "[Product].[Category] "
settings.Measures = "[Measures].[Reseller Sales Amount]"
Dim adomdDs As New AdomdDataSource(settings)
ultraPivotGrid1.DataSource = adomdDs

Adding MdxDataSelector

Overview

Although a separate control, the data selector ( MdxDataSelector) is an essential mechanism for the WinPivotGrid control; binding the data selector to the same data source as the pivot grid. The WinPivotGrid displays the list of dimensions and measures that the user can interact with at runtime by adding them to the pivot grid.

Note
Note:

If the data selector is not present at runtime, you will not be able to add the dimensions. You can only remove them from the pivot grid.

The following code example demonstrates binding data selector to the same data source as the pivot grid, using the data source object illustrated in the previous examples.

In C#:

mdxDataSelector1.DataSource = xmlaDs;

In Visual Basic:

mdxDataSelector1.DataSource = xmlaDs

The following screenshot illustrates the pivot grid with data selector both bound to XMLA data source. The same approach applied to ADOMD data source.

Adding MdxDataSelector 1.png

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This section contains topics covering the WinPivotGrid™ control for Infragistics® Windows Forms®.

This topic explains and demonstrates the WinPivotGrid™ data binding using XMLA data Source/Provider.

This topic explains how to use the FlatDataSource class for displaying IEnumerable data in the WinPivotGrid™.

This section lists common terms used in pivot grid topics.