Pivot tables and footers with sums

Hello:

I have to add some footers with total columns sums for a pivot table.

I will have to this dynamically since the number of columns can be different for each pivot made.

According with the info I have I can get a reference to the pivot table using:

var pivot = dataGrid._pv;

And then I plan to use the set of apis for grid, like getColumnCount() to iterate, get the column references and add the math using functions like #stat_total.

Is it possible to do this?
I am unable somehow unable to get the reference to the pivot.

for instance when using this:

function pivotGrid(){

dataGrid.makePivot(); // this works fine
pivot = dataGrid._pv();
alert("pivot "+ pivot.getColumnCount());

} // function

I’m getting “undefined”.

Best regards.

Javier

Solved, I took a look into dhtmlxgrid_pivot.js, the pivot grid reference is _pgrid.