I can't add a 'descending' sort on « Total » in a PivotTable.
Le
Sylvie Beaudoin
Hello,
I'm using an Office Web Component, and I can't add
a 'descending' sort on « Total » in a PivotTable.
I have a PivotControl (id= « PivotControl ») :
<OBJECT id=PivotControl style="LEFT: 0px; WIDTH: 502px;
TOP: 0px; HEIGHT: 217px" height=217 width=502
classid="CLSID:0002E552-0000-0000-C000-000000000046">
</OBJECT>
and I have a Total called (« Nombre ») in a DataAxis. I
also have a FilterAxis, a RowAxis and a ColumnAxis as:
// FILTER AXIS objFieldset = objView.FieldSets.Item("MBE
Région Admin");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext()) {
objField = e.item();
objField.IsIncluded = true;
}
objView.FilterAxis.InsertFieldSet(objFieldset);
// COLUMN AXIS
objFieldset = objView.FieldSets.Item("MBE Mode");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.ColumnAxis.InsertFieldSet(objFieldset);
// ROW AXIS
objFieldset = objView.FieldSets.Item("MBE CNP");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.RowAxis.InsertFieldSet(objFieldset);
// TOTALS IN A DATA AXIS
objView = PivotControl.ActiveView;
objView.DataAxis.InsertTotal(objView.Totals("Nombre"));
But, the Object Total(Nombre) doesn't contains a Field
Object to sort on (SortDirection). The Field Object is
equal to nothing.
I'm trying to sort using the Commands Object but, there is
no Commands in the PivotControl object and I can't execute
the command for a descending sort (Set command =
PivotControl.Commands(2031)).
I'm trying to find out what's the best way to execute a
sort on TOTALS in a pivot table ? I know I can sort using
the Web Component UI or the right-click sub-menu, but I
need to implement a sort on Totals using code to respect
the customer UI requirements using combo box and custom
toolbar on a Web page.
Any help would be appreciated
Thanks in advance
Sylvie
I'm using an Office Web Component, and I can't add
a 'descending' sort on « Total » in a PivotTable.
I have a PivotControl (id= « PivotControl ») :
<OBJECT id=PivotControl style="LEFT: 0px; WIDTH: 502px;
TOP: 0px; HEIGHT: 217px" height=217 width=502
classid="CLSID:0002E552-0000-0000-C000-000000000046">
</OBJECT>
and I have a Total called (« Nombre ») in a DataAxis. I
also have a FilterAxis, a RowAxis and a ColumnAxis as:
// FILTER AXIS objFieldset = objView.FieldSets.Item("MBE
Région Admin");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext()) {
objField = e.item();
objField.IsIncluded = true;
}
objView.FilterAxis.InsertFieldSet(objFieldset);
// COLUMN AXIS
objFieldset = objView.FieldSets.Item("MBE Mode");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.ColumnAxis.InsertFieldSet(objFieldset);
// ROW AXIS
objFieldset = objView.FieldSets.Item("MBE CNP");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.RowAxis.InsertFieldSet(objFieldset);
// TOTALS IN A DATA AXIS
objView = PivotControl.ActiveView;
objView.DataAxis.InsertTotal(objView.Totals("Nombre"));
But, the Object Total(Nombre) doesn't contains a Field
Object to sort on (SortDirection). The Field Object is
equal to nothing.
I'm trying to sort using the Commands Object but, there is
no Commands in the PivotControl object and I can't execute
the command for a descending sort (Set command =
PivotControl.Commands(2031)).
I'm trying to find out what's the best way to execute a
sort on TOTALS in a pivot table ? I know I can sort using
the Web Component UI or the right-click sub-menu, but I
need to implement a sort on Totals using code to respect
the customer UI requirements using combo box and custom
toolbar on a Web page.
Any help would be appreciated
Thanks in advance
Sylvie

Poser une question


"Sylvie Beaudoin" le message de news:1809f01c4224a$c329d740$
Hello,
I'm using an Office Web Component, and I can't add
a 'descending' sort on « Total » in a PivotTable.
I have a PivotControl (id= « PivotControl ») :
<OBJECT id=PivotControl style="LEFT: 0px; WIDTH: 502px;
TOP: 0px; HEIGHT: 217px" height!7 widthP2
classid="CLSID:0002E552-0000-0000-C000-000000000046">
</OBJECT>
and I have a Total called (« Nombre ») in a DataAxis. I
also have a FilterAxis, a RowAxis and a ColumnAxis as:
// FILTER AXIS objFieldset = objView.FieldSets.Item("MBE
Région Admin");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext()) {
objField = e.item();
objField.IsIncluded = true;
}
objView.FilterAxis.InsertFieldSet(objFieldset);
// COLUMN AXIS
objFieldset = objView.FieldSets.Item("MBE Mode");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.ColumnAxis.InsertFieldSet(objFieldset);
// ROW AXIS
objFieldset = objView.FieldSets.Item("MBE CNP");
e = new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField = e.item();
objField.IsIncluded = true;
}
objView.RowAxis.InsertFieldSet(objFieldset);
// TOTALS IN A DATA AXIS
objView = PivotControl.ActiveView;
objView.DataAxis.InsertTotal(objView.Totals("Nombre"));
But, the Object Total(Nombre) doesn't contains a Field
Object to sort on (SortDirection). The Field Object is
equal to nothing.
I'm trying to sort using the Commands Object but, there is
no Commands in the PivotControl object and I can't execute
the command for a descending sort (Set command PivotControl.Commands(2031)).
I'm trying to find out what's the best way to execute a
sort on TOTALS in a pivot table ? I know I can sort using
the Web Component UI or the right-click sub-menu, but I
need to implement a sort on Totals using code to respect
the customer UI requirements using combo box and custom
toolbar on a Web page.
Any help would be appreciated
Thanks in advance
Sylvie