Reputation: 101
I would like to retrieve data from activePivot's cube by sending MDX with Rest request. I tried to do it and I retrieved a json object then I parsed this json object to retrieve just specific information (look to the picture).
I had a look on this question : Can I connect ActivePivot to the tableau software?, but it is not complete.
Now I would like to render information whatever the request is, in a dynamic table in a web page. How can I do it?
Upvotes: 3
Views: 428
Reputation: 7655
You are trying to perform what we call the rendering of a Pivot Table from a CellSet. The CellSet (and optionally the corresponding Cube discovery information) are sufficient to perform this task and you could write it yourself by basically just iterating on the axes and the cells on the CellSet. There is no open-source library that will help you do so to my knowledge (the REST Api you are using is recent).
Since you are using ActivePivot you might be aware of ActivePivot Live 4 which is the UI front end for ActivePivot, which consumes the same API you are consuming and contains a TabularView component that performs what you are trying to do, with a lot of added features that could be interesting for you, named:
This product contains a lot more features that you can for instance see in these two videos (everytime you see a table with data this is the TabularView): https://www.youtube.com/watch?v=-B07d4meYbQ and https://www.youtube.com/watch?v=QMTVAtdpuRs .
So if you are using ActivePivot Live, you can display any MDX as a table in a div with the id table
with the following code:
const servers = ActivePivotLive.api.queries.serversPool;
const server = servers.addActivePivotServer({url: 'http://localhost:9090'});
conat tabularView = ActivePivotLive.api.widgets.createTabularView()
.withMdx(yourMdx)
.within('table');
Then later you can change the mdx with
tabularView.getQuery().setMdx(newMdx)
So that you can wrap this inside an Angular directive for instance.
Otherwise you will have to implement it yourself but can of course ask for help here if you have particular issues or bugs you encounter while trying to implement it.
Upvotes: 2