OWC, 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
Rgion 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
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
Clément Marcotte
Le #1272258
I serais very surpris that with ce name you could not be capable asker
this question en français.

"Sylvie Beaudoin" le message de news:1c89501c4224a$00766560$

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
hello
Le #1243922
Bonsoir,
Excellent ! Sieur Clément, si vous le permettez I will
reservirai :)
@+
-----Message d'origine-----
I serais very surpris that with ce name you could not be
capable asker

this question en français.

"Sylvie Beaudoin" a écrit dans

le message de news:1c89501c4224a$00766560
$


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

.



Clément Marcotte
Le #1272254
Bonjour

Excellent ! Sieur Clément, si vous le permettez I will
reservirai :)


Pas de problème ;-)

Publicité
Poster une réponse
Anonyme