Get AggregateResult for a specific column

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    17 posts
    Member since:
    Jan 2011

    Posted 03 Sep 2014 Link to this post

    Hi,
    I'm trying to implement the Excel export via spread processing and I can't get the aggregation result for specific columns for my footer row. I don't have groups so I can't use columns[i].GetAggregateResults() and AggregateResult does not have a public property for the column name (aggregateFunction is private and I can't access it with reflection in Silverlight).

    I can't use the index of the AggregateResult either since I have to be pretty much generic here and not every column has an AggregateResult. So the only identifier here would be the index of the column or the field name of the column.

    Do you have any idea how one could achieve this?
  2. Thomas
    Thomas avatar
    17 posts
    Member since:
    Jan 2011

    Posted 04 Sep 2014 Link to this post

    Ok, got it figured out:

    if (columns[i].AggregateFunctions.Any())
    {
      foreach (AggregateFunction function in columns[i].AggregateFunctions)
      {
        var value = aggregateResults[function.FunctionName].FormattedValue.ToString();
         ...
      }
    }
  3. DevCraft banner
Back to Top