protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues = 
            {
                aggregateSummaryValues.GetAggregateValue("Printer stand"),
                aggregateSummaryValues.GetAggregateValue("Mouse pad"),
            };


            foreach (AggregateValue val in aggregateValues)
            {
                if (val.IsError())
                {
                    return new DoubleAggregateValue(0);
                }
            }

            if (aggregateValues.ContainsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            double value = aggregateValues.Average(av => av.ConvertOrDefault<double>());

            return new DoubleAggregateValue(value);
        }
예제 #2
0
    protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
    {
        AggregateValue[] aggregateValues = {
            aggregateSummaryValues.GetAggregateValue("Andrew Fuller"),
            aggregateSummaryValues.GetAggregateValue("Michael Suyama"),
            aggregateSummaryValues.GetAggregateValue("Robert King"),
            aggregateSummaryValues.GetAggregateValue("Steven Buchanan")
        };

        if (aggregateValues.ContainsError())
        {
            return AggregateValue.ErrorAggregateValue;
        }

        double average = aggregateValues.Average(av => av.ConvertOrDefault<double>());
        return new DoubleAggregateValue(average);
    }
예제 #3
0
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues =
            {
                aggregateSummaryValues.GetAggregateValue(new QuarterGroup(1)),
                aggregateSummaryValues.GetAggregateValue(new QuarterGroup(2))
            };

            if (aggregateValues.ContainsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault <double>());

            return(new DoubleAggregateValue(sum));
        }
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues = 
            {
                aggregateSummaryValues.GetAggregateValue(new QuarterGroup(1)),
                aggregateSummaryValues.GetAggregateValue(new QuarterGroup(2))
            };

            if (aggregateValues.ContainsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault<double>());

            return new DoubleAggregateValue(sum);
        }
        protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues = {
               aggregateSummaryValues.GetAggregateValue("Anne Dodsworth"),
               aggregateSummaryValues.GetAggregateValue("Janet Leverling"),
               aggregateSummaryValues.GetAggregateValue("Laura Callahan"),
               aggregateSummaryValues.GetAggregateValue("Margaret Peacock"),
               aggregateSummaryValues.GetAggregateValue("Nancy Davolio")
            };

            if (aggregateValues.ContainsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            double average = aggregateValues.Average(av => av.ConvertOrDefault<double>());
            return new DoubleAggregateValue(average);
        }
예제 #6
0
        protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues =
            {
                aggregateSummaryValues.GetAggregateValue("Andrew Fuller"),
                aggregateSummaryValues.GetAggregateValue("Michael Suyama"),
                aggregateSummaryValues.GetAggregateValue("Robert King"),
                aggregateSummaryValues.GetAggregateValue("Steven Buchanan")
            };

            if (aggregateValues.ContainsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            double average = aggregateValues.Average(av => av.ConvertOrDefault <double>());

            return(new DoubleAggregateValue(average));
        }
        protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues =
            {
                aggregateSummaryValues.GetAggregateValue("Anne Dodsworth"),
                aggregateSummaryValues.GetAggregateValue("Janet Leverling"),
                aggregateSummaryValues.GetAggregateValue("Laura Callahan"),
                aggregateSummaryValues.GetAggregateValue("Margaret Peacock"),
                aggregateSummaryValues.GetAggregateValue("Nancy Davolio")
            };

            if (aggregateValues.ContainsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            double average = aggregateValues.Average(av => av.ConvertOrDefault <double>());

            return(new DoubleAggregateValue(average));
        }
예제 #8
0
        protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue aggregateValue = aggregateSummaryValues.GetAggregateValue("Canada");

            if (aggregateValue.IsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            var value = aggregateValue.ConvertOrDefault<double>() > 500 ? 500 : 0;
            return new DoubleAggregateValue(value);
        }
예제 #9
0
        protected override AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue aggregateValue = aggregateSummaryValues.GetAggregateValue("Canada");

            if (aggregateValue.IsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            var value = aggregateValue.ConvertOrDefault <double>() > 500 ? 500 : 0;

            return(new DoubleAggregateValue(value));
        }
예제 #10
0
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues = 
            {
                aggregateSummaryValues.GetAggregateValue("Argentina"),
                aggregateSummaryValues.GetAggregateValue("Brazil"),
                aggregateSummaryValues.GetAggregateValue("Canada"),
                aggregateSummaryValues.GetAggregateValue("Mexico"),
                aggregateSummaryValues.GetAggregateValue("USA"),
                aggregateSummaryValues.GetAggregateValue("Venezuela")
            };

            if (aggregateValues.ContainsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault<double>());

            return new DoubleAggregateValue(sum);
        }
예제 #11
0
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues =
            {
                aggregateSummaryValues.GetAggregateValue("Argentina"),
                aggregateSummaryValues.GetAggregateValue("Brazil"),
                aggregateSummaryValues.GetAggregateValue("Canada"),
                aggregateSummaryValues.GetAggregateValue("Mexico"),
                aggregateSummaryValues.GetAggregateValue("USA"),
                aggregateSummaryValues.GetAggregateValue("Venezuela")
            };

            if (aggregateValues.ContainsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault <double>());

            return(new DoubleAggregateValue(sum));
        }
예제 #12
0
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues =
            {
                aggregateSummaryValues.GetAggregateValue("Italy"),
                aggregateSummaryValues.GetAggregateValue("Germany"),
                aggregateSummaryValues.GetAggregateValue("Austria"),
                aggregateSummaryValues.GetAggregateValue("Belgum"),
                aggregateSummaryValues.GetAggregateValue("Denmark"),
                aggregateSummaryValues.GetAggregateValue("France"),
                aggregateSummaryValues.GetAggregateValue("Ireland"),
                aggregateSummaryValues.GetAggregateValue("Norway"),
                aggregateSummaryValues.GetAggregateValue("Poland"),
                aggregateSummaryValues.GetAggregateValue("Portugal"),
                aggregateSummaryValues.GetAggregateValue("Spain"),
                aggregateSummaryValues.GetAggregateValue("Sweden"),
                aggregateSummaryValues.GetAggregateValue("Switzerland"),
                aggregateSummaryValues.GetAggregateValue("UK")
            };

            if (aggregateValues.ContainsError())
            {
                return(AggregateValue.ErrorAggregateValue);
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault <double>());

            return(new DoubleAggregateValue(sum));
        }
예제 #13
0
        protected override Telerik.Pivot.Core.Aggregates.AggregateValue GetValue(IAggregateSummaryValues aggregateSummaryValues)
        {
            AggregateValue[] aggregateValues = 
            {
                aggregateSummaryValues.GetAggregateValue("Italy"),
                aggregateSummaryValues.GetAggregateValue("Germany"),
                aggregateSummaryValues.GetAggregateValue("Austria"),
                aggregateSummaryValues.GetAggregateValue("Belgum"),
                aggregateSummaryValues.GetAggregateValue("Denmark"),
                aggregateSummaryValues.GetAggregateValue("France"),
                aggregateSummaryValues.GetAggregateValue("Ireland"),
                aggregateSummaryValues.GetAggregateValue("Norway"),
                aggregateSummaryValues.GetAggregateValue("Poland"),
                aggregateSummaryValues.GetAggregateValue("Portugal"),
                aggregateSummaryValues.GetAggregateValue("Spain"),
                aggregateSummaryValues.GetAggregateValue("Sweden"),
                aggregateSummaryValues.GetAggregateValue("Switzerland"),
                aggregateSummaryValues.GetAggregateValue("UK")
            };

            if (aggregateValues.ContainsError())
            {
                return AggregateValue.ErrorAggregateValue;
            }

            double sum = aggregateValues.Sum(s => s.ConvertOrDefault<double>());

            return new DoubleAggregateValue(sum);
        }