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
305
retrieve the selected rows and columns from a pivotview
posted

I'd like to get the current selected data options like columns, rows,measures and filters on the client side. when I interigate the datasourceoptions the values are always null.

the code I've tried is below.

Also I'm using a remotedatasource, and I was wondering if there was an event or a way to grab the mdx that is being sent to the olap server.

thanks for the info..

the code I've tried for retrieving the options are below:

var dataSelector = $("#pivotView").igPivotView("dataSelector");

 

var ds = $("#pivotView").igPivotView("option", "dataSourceOptions");

alert(ds);

alert(ds.xmlaOptions.cube);

Parents
  • 775
    Verified Answer
    posted

    Hello Rob,

    In order to get the columns, rows, measures or filters on the client you can use on of these options:

        var measures = $("#pivotView").igPivotView("option", "dataSource").dataSource().measures();

        var filters = $("#pivotView").igPivotView("option", "dataSource").dataSource().filters();

        var rows = $("#pivotView").igPivotView("option", "dataSource").dataSource().rowAxis();

        var columns = $("#pivotView").igPivotView("option", "dataSource").dataSource().columnAxis();

    Each one of those will return the corresponding collection of items. In order to get their count you can use:

        var measuresLength = measures.inner().length;

        var filtersLength = filters.inner().length;

        var rowsLength = rows.inner().length;

        var columnsLength = columns.inner().length;

    There is another way of directly accessing the items:

        var firstMeasure = measures.item(0);

        var secondMeasure = measures.item(1);

    Where "secondMeasure" will be undefined if there is only one measure added to the pivot grid.

    About your second question: there is no build-in way and no event to get the MDX that is being sent.

    If there are any other questions that I might answer, please don't hesitate to ask.

    Thanks,

    Martin Stoev

Reply Children