Galaktikasoft

Overriding Ranet OLAP Pivot Table Backend Using API

Last week, we wrote how to configure the front-end of Ranet OLAP Pivot Table for HTML. Now, let’s talk about overriding the backend of the solution.

Ranet OLAP Pivot Table provides API for working with the server code. WebApi controllers are an intermediate link between our client code and data providers (Oracle Hyperion Essbase, Microsoft Analysis Services, Pentaho Mondrian, and IBM TM1). Figure shows our solution pattern.

Ranet HTML Pivot Table solution pattern

Each of our WebApi controllers can be overridden in your application.

We will show an example of overriding the logic of the controller responsible for working with the data. We already wrote how to integrate Ranet in an ASP.NET application, so let’s start right with overriding the logic. To do this, we have to create CustomDirectRouteProvider class.

Then communicate CustomDirectRouteProvider to the WebAPI. In order to do this, we have to modify WebApiConfig class.

Create WebAPI controller in the project, which will interact with the front-end of our solution when data is required. Now create CustomDataSourceController class in the Controllers folder of the solution.

After we have created our data provider, we would like to override only some methods of the initial controller. We have to inherit our new provider from the initial one and override the method where we will be able to filter the cubes, which will be the basis of the end users’ reports.

Let’s consider a more complicated scenario where we’d like to filter the pivot table data in the application. In this case, we’ll have to create a query to retrieve the data.

First, create a simple report.

Let’s say, we do not want to display data about certain categories of goods to certain users. To do this, we have to override GetQueryBuilderParameters method where we'll set SubCube property for the return parameter, which will be integrated into the end query run to retrieve data for the pivot table.

Let’s open the same report once again and look at the data in the pivot table. As Figure 12 clearly shows, the data about Accessories and Components has been excluded from the report.

We hope you found this post helpful.
If you still have any questions about using our Ranet OLAP Pivot Table API, feel free to ask us questions in the comments section.