Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Expand pivot data programmatically not working for OLAP XMLA datasource
posted

We are tryping to use igpivotgrid with olap xmla data source and want to have expand and collapse functionality on button click.

For this, we are using below code

 <input type="button" onclick="expand()" value="Expand" />

function expand() {
var tuplesCount, membersCount;
for (var x = 0; x < dataSource.result().axes().count() ; x++) {
tuplesCount = dataSource.result().axes().item(x).tuples().count();
for (var i = 0; i < tuplesCount; i++) {
membersCount = dataSource.result().axes().item(x).tuples().item(i).members().count();
for (var j = 0; j < membersCount; j++) {
if (dataSource.result().axes().item(x).tuples().item(i).members().item(j).isExpandable()) {
dataSource.expandTupleMember(dataSource.result().axes().item(x).name(), i, j);
dataSource.update();
}
}
}
}
}

After adding a meaure and a dimension, on first "Expand" button click, it throws an error in browser console "TypeError: Cannot read property 'createAxis' of null(…)"

Error on expand pivot grid

Error on expand pivot grid

Error on expand pivot grid