G
Guille Rugilo
Hi, I'm trying to show some totals in a pivot table, using javascript on the
client-side for filling and displaying the pivot table with a default view.
The problem is that the total is not displayed in the table, instead, a
column named "No Details" appears.
There is a curious detail: if I run the application, and add another field
(say "Time") to the Totals (by adding the field Time to the Data Area), then
both totals, Time and Money, are displayed ok in the table...
Here is my code:
var ptConstants = document.forms[0].pivotTable.Constants;
var totalMoney = activeView.AddTotal("Sum of Money",
activeView.FieldSets("[Money]").Fields(0), ptConstants.plFunctionSum);
activeView.DataAxis.InsertTotal( totalMoney );
totalMoney.DisplayInFieldList = true;
activeView.TotalOrientation = ptConstants.plTotalOrientationColumn;
activeView.DisplayCalculatedMembers = true;
document.forms[0].pivotTable.DisplayFieldList = true;
document.forms[0].pivotTable.AllowDetails = true;
document.forms[0].pivotTable.Refresh();
Thanks.
client-side for filling and displaying the pivot table with a default view.
The problem is that the total is not displayed in the table, instead, a
column named "No Details" appears.
There is a curious detail: if I run the application, and add another field
(say "Time") to the Totals (by adding the field Time to the Data Area), then
both totals, Time and Money, are displayed ok in the table...
Here is my code:
var ptConstants = document.forms[0].pivotTable.Constants;
var totalMoney = activeView.AddTotal("Sum of Money",
activeView.FieldSets("[Money]").Fields(0), ptConstants.plFunctionSum);
activeView.DataAxis.InsertTotal( totalMoney );
totalMoney.DisplayInFieldList = true;
activeView.TotalOrientation = ptConstants.plTotalOrientationColumn;
activeView.DisplayCalculatedMembers = true;
document.forms[0].pivotTable.DisplayFieldList = true;
document.forms[0].pivotTable.AllowDetails = true;
document.forms[0].pivotTable.Refresh();
Thanks.