OlapDataSource Class

Base class for OLAP (Online Analytical Processing) data sources.
Public MustInherit Class OlapDataSource 
public abstract class OlapDataSource 

The OlapDataSource class is an abstract class which defines the interface through which a data consumer (such as the UltraPivotGrid control) communicates with an OLAP data server.

Because communication with an OLAP server is accomplished through client requests and server responses, most of the methods exposed by this class, and derived classes, are asynchronous in nature.

Many of the asynchronous methods exposed by this class follows a design pattern that makes it possible for the consumer to easily obtain data from the OLAP server, without the need for a complicated multi-threaded consumer implementation. The main features of this pattern are as follows:

  • A naming convention which suffixes all applicable methods with the phrase 'Async'.
  • An event which fires after the server responds to the request.
  • An optional parameter which provides the ability to specify whether the server request should be sent immediately, or deferred until the data source is updated manually.
  • An optional parameter which provides the ability to specify the thread on which the server raises this event.
  • A separate event which occurs when an exception is thrown by the server during processing of a request.

For example, consider the ExpandAxisTupleMemberAsync method. The first three method parameters allow the caller to specify the axis on which the member resides, the index of the tuple containing the member to expand, and the index of the member to expand, respectively.

Setting the value of the 'update' parameter to false allows the caller to defer the update until the UpdateAsync method is called. This provides a way to perform 'batch' style updating, where more than one change is made to the data source, with the multiple changes being applied later, as one atomic operation.

When true is specified as the value of the 'update' parameter, the request is dispatched to the OLAP server immediately. If, during processing of the request, an exception is thrown, the DataSourceError event occurs, reporting the error to listeners.

If the request is processed successfully, and the value of the 'update' parameter is set to true, the ExpandAxisTupleMemberAsyncCompleted event occurs, notifying listeners that the operation has been completed.

Notifications received from the OLAP server are dispatched on a background thread. Because Windows Forms controls are not thread safe, attempting to access properties or methods exposed by the control directly from within the contents of the event handler can cause a cross-thread exception to occur. The 'control' parameter provides a way for the developer to direct these notifications to the same thread as the one on which the control's handle was created. This eliminates the need for the listener to marshal the notification across thread boundaries, further simplifying the client implementation.


Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also