OlapDataManager in WPF OLAP Common

OlapDataManager is the most important class in the whole OLAP base. All the information are transferred from the control to OLAP base through this class and this will retain the current state of the base objects. The connection is established in the data provider of the OLAP base, but the information required in establishing the connection is given to the data provider through the OlapDataManager.

Constructors

Constructors Description Parameters Return Type Reference Link
OlapDataManager() Default constructor - Void -
OlapDataManager(string) Accepts the connection string as an argument and passes it to the data provider to establish the connection with data source. String Void -
OlapDataManager(AdomdDataProvider) Accepts the data provider as an argument and processes the cube that is connected with the given data provider. AdomdDataProvider Void -

Establishing connection with the SSAS server

The following code snippet describes establishing connection with the server.

OlapDataManager olapDataManager = new OlapDataManager("DataSource=localhost; Initial Catalog=Adventure Works DW");
OlapDataManager olapDataManager = New OlapDataManager("DataSource=localhost; Initial Catalog=Adventure Works DW")

Establishing connection with the SSAS server through data provider

The following code snippet describes establishing connection with the server.

AdomdDataProvider dataProvider = new AdomdDataProvider("DataSource=localhost; Initial Catalog=Adventure Works DW");

OlapDataManager olapDataManager = new OlapDataManager(dataProvider);
Dim dataProvider As AdomdDataProvider = New AdomdDataProvider("DataSource=localhost; Initial Catalog=Adventure Works DW")

Dim olapDataManager As OlapDataManager = New OlapDataManager(dataProvider) 

Establishing connection with the offline cube

The following code snippet describes establishing connection with the offline cube.

OlapDataManager olapDataManager = new OlapDataManager(@"Data Source = C:\ Common\Data\OfflineCube\Adventure_Works_Ext.cub; Provider = MSOLAP;");
OlapDataManager olapDataManager = New OlapDataManager("Data Source = C:\\ Common\\Data\\OfflineCube\\Adventure_Works_Ext.cub; Provider = MSOLAP;") 

Establishing connection with XMLA Server

XML for Analysis (XMLA) is a standard that allows the client applications to transfer multi-dimensional or OLAP data sources, which is available in the Mondrian Server. The back and forth communication is done using the web standards – HTTP, SOAP, and XML. The query language used is MDX, which is most widely supported for reporting from multi-dimensional data stores.

Connecting to Mondrian Server

The following code illustrates how to connect to the Mondrian Server.

// Connecting to Mondrian Server

OlapDataManager DataManager = new OlapDataManager("Data Source = http://localhost:8080/mondrian/xmla; Initial Catalog = FoodMart;");

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.Mondrian;
' Connecting to Mondrian Server 

Dim DataManager As OlapDataManager = New OlapDataManager("Datasource = http://bi.syncfusion.com:8080/mondrian/xmla; Initial Catalog=FoodMart;")

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.Mondrian

Click here for more information about Mondrian XMLA configurations.

Connecting to Active Pivot Server

The following code illustrates how to connect to the Active Pivot Server.

// Connecting to Active Pivot Server

OlapDataManager DataManager = new OlapDataManager(@"Data Source=http://localhost:8081/var_s/xmla;  Initial Catalog=VaRCubes; User ID=; Password=; Transport Compression=None;");

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.ActivePivot;
' Connecting to Active Pivot Server 

Dim DataManager As OlapDataManager = New OlapDataManager("Data Source=http://localhost:8081/var_s/xmla;  Initial Catalog=VaRCubes; User ID=; Password=; Transport Compression=None;")

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.ActivePivot

Click here for more information on Active Pivot server.

Connecting to SAP Business Warehouse Server

The following code illustrates how to connect to the SAP Business Warehouse server.

// Connecting to SAP BW Server

OlapDataManager DataManager = new OlapDataManager(@"Data Source= http://sapdomain:50000/sap/bw/xml/soap/xmla; Initial Catalog=$INFOCUBE; User ID=username; Password=password;");

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.SAPBW;
' Connecting to SAP BW Server 

Dim DataManager As OlapDataManager = New OlapDataManager("Data Source= http://sapdomain:50000/sap/bw/xml/soap/xmla; Initial Catalog=$INFOCUBE; User ID=username; Password=password;")

DataManager.DataProvider.ProviderName = Syncfusion.Olap.DataProvider.Providers.SAPBW

Click here for more information on SAP BW server.

Properties

  • ConnectionString: Passes the connection string to establish the connection. Users can also get the connection string using this property.
  • CurrentCellSet: Gets the CellSet of user’s input from here.
  • CurrentCubeName: Sets or gets the current cube name. When set, the whole data procession will change to the specified cube name.
  • CurrentCubeSchema: Gets the CubeSchema of the currently connected cube.
  • CurrentReport: Loads an OlapReport or get the currently loaded report.
  • DataProvider: Sets a data provider and gets the existing data provider.
  • IsCurrentReportModified: Gets or sets the modified status of the currently loaded report.
  • MdxQuery: Passes the MDX query as input.
  • PivotEngine: Gets the pivot engine for the given input.
  • QuerySpecification: Gets the MDXQuerySpecification for the given OlapReport.
  • ReportPath: Gets or sets the report path to store the report as an XML file.
  • Reports: Contains the report collection of the OlapDataManager.

Methods

Method Name Description Parameters Return Type Reference Link
AddReport Used to add a new OlapReport to the report collection of OlapDataManager. OlapReport Void -
CloneOlapDataManager Create a clone from the current state of OlapDataManager and return the new copy of OlapDataManager. The IDataProvider will be same for both the managers. - OlapDataManager -
ExecuteCellSet This is an overloaded method that can be invoked by calling or passing the MDXQuerySpecification or by passing the MDX query as a string. This method invokes the data processing and returns the processed CellSet, which will be further formatted. - CellSet ExecuteCellSet
ExecuteOlapTable Used to create pivot engine from the CellSet. - PivotEngine
GetMDXQuery This method generates an MDX query from the MDXQuerySpecification and returns the query as a string. - string -
GetReport This method returns the OlapReport collection by giving the XML report file name as an input. string OlapReportCollection -
GetReportAsStream This method returns the current report collection along with current state of OlapDataManager as a stream. - Stream GetReportAsStream
LoadOlapDataManager Used to accept the OlapReport as an argument and loads the OlapDataManager with the given OlapReport. OlapReport Void LoadOlapDataManager
LoadReport Used to get the report name as an argument and pick the specified report from the report collection to load the OlapDataManager with that report. string Void -
LoadReportDefinitionFile Used to get the XML report file as an input and load the OlapDataManager with the report in that file. string Void LoadReportDefinitionFile
LoadReportDefinitionFromStream Used to get a stream as an input and read the report from that stream and load the OlapDataManager with that report. Stream Void LoadReportDefinitionFromStream
NotifyElementModified Used to trigger the ElementModified event. - Void -
NotifyReportChanged Used to trigger the ReportChanged event. - Void -
RemoveReport Used to get the report name as an input and remove that report from the report collection. string Void RemoveReport
RenameReport Used to rename the current report of OlapDataManager. Index as int and new Report Name as string void RenameReport
SaveReport Used to get the file name and store the current report collection along the current state of the OlapDataManager as an XML file. string Void SaveReport
SetCurrentReport Used to set an OlapReport as the current report of the OlapDataManager. This method is the initial method that will start data processing. OlapReport Void SetCurrentReport

UseWhereClauseForSlicing

The UseWhereClauseForSlicing property facilitates the user to decide whether the MDX query parser engine should consider ‘Where’ or ‘Select’ clause for slicing data.

Properties

  • UseWhereClauseForSlicing: Enables users to decide whether the MDX Query Parser Engine should consider the ‘Where’ or ‘Select’ clause for slicing operation.

Drill through

This feature enables the user to drill through any value and see the data which formed the value.

The following code snippet illustrates how to drill through using the MDX Query in OlapDataManager.

string query = @"drillthrough Select { [Customer].[Customer Geography].[Country].&[Australia] } on 0, { [Date].[Fiscal].[Fiscal Year].&[2002] } on 1 from [Adventure Works] Where [Internet Sales Amount]";

// executing the drill-through operation.

olapDataManager.Execute(query);
Dim query As String = "drillthrough Select { [Customer].[Customer Geography].[Country].&[Australia] } on 0, { [Date].[Fiscal].[Fiscal Year].&[2002] } on 1 from [Adventure Works] Where [Internet Sales Amount]" 

'Executing the drill-through operation.

olapDataManager.Execute(query)