Pivot tables are one of the most powerful features within Microsoft Excel. A pivot table allows you to analyze thousands of rows of data with just a few mouse clicks, show the results in an easy to read table, “pivot”/change the report layout by dragging fields around, highlight key information to management and include charts in your presentations.
With Wijmo’s OLAP module, you can add all that power to your web applications.
The OLAP module includes the following components:
The simplest and easiest way to use the PivotEngine is to assign JavaScript arrays or CollectionView objects containing the raw data to the engine’s itemsSource property. The data can be calculated or retrieved from arbitrary services.
For example:
var engine = new wijmo.olap.PivotEngine({
itemsSource: getDataArray()
});
Using local data is an easy, adequate approach for relatively small amounts of data (say up to about 50,000 data items). Once the engine is set up, you may build views using code or let users build them using a PivotPanel control. Once builds are defined, the engine will send requests to the server, retrieve the results, and expose them through the pivotView property. In most cases, the results will be displayed in PivotGrid or PivotChart controls connected to the engine or to the panel.
For large data sets, however, using local data can be impractical. Loading a million records of data over the wire can take a significant amount of time, especially when using mobile devices. In these cases, you may prefer to use a server to store and aggregate the data, and use Wijmo OLAP as a front-end to build views and display results.
Wijmo OLAP supports two types of remote scenarios:
This option is recommended if you already have an instance of SSAS installed and running. In this case, all you have to do is configure the server to give your application access to the data and set the PivotEngine’s itemsSource property to an object that contains the cube’s name and URL.
For example:
var ng = new wijmo.olap.PivotEngine({
itemsSource: {
url: 'http://ssrs.componentone.com/OLAP/msmdpump.dll',
cube: 'Adventure Works'
}
});
This is the only difference between an app that uses Wijmo OLAP with local or remote data. Everything else, including the steps required to build, edit, save, and restore views, as well as display or export results, is identical in local and remote data scenarios.
The sections below summarize the steps required to install, create, and configure SSAS OLAP cubes:
For detailed information on how to install the SQL Server Analysis Services, refer to the MSDN tutorial.
For detailed information on how to create, define, and deploy the OLAP multidimensional cube, refer to the MSDN multidimensional modelling tutorial.
To enable the HTTP access to SQL Server Analysis Services, use an MSMDPUMP.DLL ISAPI extension. For detailed information on how to set up the MSMDPUMP.DLL extension, refer to the MSDN HTTP access tutorial. For an online accessible OLAP service for test purposes, use the url listed in the example above.
If you want to use the cube in cross-domain scenarios, you must set up Cross-Origin Resource Sharing (CORS).
To allow cross-domain requests to the OLAP service, enable the CORS behavior of your server. The following sections demonstrate how to enable CORS on Internet Information Services (IIS) servers. Cross-domain access requires you to configure the HTTP Response Headers and the OPTIONS method server response.
To configure HTTP Response Headers, specify:
For example:
Header Name |
Value | Details |
Access-Control-Allow-Headers | Origin, Content-Type, Accept |
These are the names of the fields required to be used in the actual request. Values should be comma-separated. Origin –where the cross-origin or preflight request originates from. This setting tells the server that the origin, which performs the request is a known one. Content-Type –the content (MIME) type of the entity body sent to the recipient. Accept – this field specifies the media types which are acceptable for the response. |
Access-Control-Allow-Origin | URI names that may access the resource. When an asterisk (*) is defined, all domains are allowed. | The names of the allowed domains should be separated by comma (,). |
Access-Control-Request-Method | POST | HTTP method to be used in the actual request. The XMLA protocol specifies an HTTP POST method. |
Access-Control-Allow-Allow-Credentials (authenticated access only) | true |
Allowed values are: true – allows supplying credentials with the request. false – disable supplying credentials with the request. |
To configure the OPTIONS method server response, specify the server response to the OPTIONS method requests. In IIS, configure the behavior of the OPTIONS method through the OPTIONSVerbHandler mapping settings.
The following example demonstrates the list of settings that you have to apply.
HTTP Handler Name |
Required Access Level | Details |
OPTIONSVerbHandler | Read | Specifies that the handler requires READ access to the requests. |
To implement a secured access to the OLAP instance, use either of the following approaches:
Wijmo OLAP offers another option which is to connect to ComponentOne’s data engine services, which offer high-volume/high-performance services as well as indirect access to SSAS OLAP cubes. The ComponentOne DataEngine services are documented separately. For more details, please refer to ComponentOne DataEngine Services.
The diagram below illustrates the three types of itemsSource you can use with Wijmo’s PivotEngine component:
Option 1 is adequate for small data sets, in the order of 50,000 items or less. It is the simplest option, since it does not require any server-side component.
Option 2 is the best option for accessing SSAS OLAP cubes. It does not require any custom server-side components (besides the SSAS OLAP server) and does not require you to purchase any additional products besides Wijmo OLAP.
Option 3 is the most powerful and flexible. ComponentOne Data Engine Services allows you to create your own custom servers using whatever data you want, with great performance for huge data sets. It also allows you to use SSAS OLAP cubes if you want. It does require you to write some code on the server side, and to purchase the ComponentOne Studio Web API Edition, which is included in the ComponentOne Ultimate bundle with Wijmo.
For a sample showing all the options above, please see our OlapServerIntro sample.