Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

I can't add a 'descending' sort on « Total » in a PivotTable.

1 réponse
Avatar
Sylvie Beaudoin
Hello,

I'm using an Office Web Component, and I can't add=20
a 'descending' sort on =AB Total =BB in a PivotTable.

I have a PivotControl (id=3D =AB PivotControl =BB) :
<OBJECT id=3DPivotControl style=3D"LEFT: 0px; WIDTH: 502px;=20
TOP: 0px; HEIGHT: 217px" height=3D217 width=3D502=20
classid=3D"CLSID:0002E552-0000-0000-C000-000000000046">=20
</OBJECT>

and I have a Total called (=AB Nombre =BB) in a DataAxis. I=20
also have a FilterAxis, a RowAxis and a ColumnAxis as:=20
// FILTER AXIS objFieldset =3D objView.FieldSets.Item("MBE=20
R=E9gion Admin");=20
e =3D new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext()) {
objField =3D e.item();
objField.IsIncluded =3D true;
}
objView.FilterAxis.InsertFieldSet(objFieldset);

// COLUMN AXIS
objFieldset =3D objView.FieldSets.Item("MBE Mode");
e =3D new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField =3D e.item();
objField.IsIncluded =3D true;
}
objView.ColumnAxis.InsertFieldSet(objFieldset);

// ROW AXIS
objFieldset =3D objView.FieldSets.Item("MBE CNP");
e =3D new Enumerator(objFieldset.Fields);
for (;!e.atEnd();e.moveNext())
{
objField =3D e.item();
objField.IsIncluded =3D true;
}
objView.RowAxis.InsertFieldSet(objFieldset);

// TOTALS IN A DATA AXIS
objView =3D PivotControl.ActiveView;=20
objView.DataAxis.InsertTotal(objView.Totals("Nombre"));


But, the Object Total(Nombre) doesn't contains a Field=20
Object to sort on (SortDirection). The Field Object is=20
equal to nothing.

I'm trying to sort using the Commands Object but, there is=20
no Commands in the PivotControl object and I can't execute=20
the command for a descending sort (Set command =3D=20
PivotControl.Commands(2031)).

I'm trying to find out what's the best way to execute a=20
sort on TOTALS in a pivot table ? I know I can sort using=20
the Web Component UI or the right-click sub-menu, but I=20
need to implement a sort on Totals using code to respect=20
the customer UI requirements using combo box and custom=20
toolbar on a Web page.

Any help would be appreciated

Thanks in advance

Sylvie

1 réponse

Avatar
Clément Marcotte
Well sur, well sur


"Sylvie Beaudoin" a écrit dans
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