This is a migrated thread and some comments may be shown as answers.

[Solved] Group Footer and Aggregates export showing unwanted info

1 Answer 131 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Spartan IV
Top achievements
Rank 1
Spartan IV asked on 25 Nov 2010, 12:13 AM

 

  [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; 417 0 [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; 185 [QCVG: Key=Australia; ItemCount=48; HasSubgroups=False; ParentGroup=[QCVG: Key=Root; ItemCount=897; HasSubgroups=True; ParentGroup=null];]; 309,848

Why this information is displayed where I don't have an aggregate?

If there is not an aggreate on the group footer it should be empty, this is not what I wanted. I need to export aggregate results

1 Answer, 1 is accepted

Sort by
0
Spartan IV
Top achievements
Rank 1
answered on 25 Nov 2010, 01:57 AM
Well found an easy solution:

This is from the demo code:

...
else if (e.Element == ExportElement.GroupFooterCell)
{
    GridViewDataColumn column = e.Context as GridViewDataColumn;
    QueryableCollectionViewGroup qcvGroup = e.Value as QueryableCollectionViewGroup;
    if (column != null && qcvGroup != null && column.AggregateFunctions.Count() > 0)
    {
        e.Value = GetAggregates(qcvGroup, column);
    }
    else
    {
        e.Value = String.Empty; //If you don't do that you will get all that unwanted info
    }
}

//Common sense :)

Tags
GridView
Asked by
Spartan IV
Top achievements
Rank 1
Answers by
Spartan IV
Top achievements
Rank 1
Share this question
or