Example #1
0
        void pivotGrid_CustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
        {
            switch (SelectedDemo)
            {
            case 0:
                if (!object.ReferenceEquals(e.Field, pivotGrid.Fields[0]))
                {
                    return;
                }
                if (Convert.ToChar(e.Value.ToString()[0]) < 'F')
                {
                    e.GroupValue = "A-E";
                    return;
                }
                if (Convert.ToChar(e.Value.ToString()[0]) > 'E' && Convert.ToChar(e.Value.ToString()[0]) < 'T')
                {
                    e.GroupValue = "F-S";
                    return;
                }
                if (Convert.ToChar(e.Value.ToString()[0]) > 'S')
                {
                    e.GroupValue = "T-Z";
                }
                break;

            case 1:
                if (!object.ReferenceEquals(e.Field, pivotGrid.Fields[3]))
                {
                    return;
                }
                e.GroupValue = ((DateTime)e.Value).Year + " - " + ((((DateTime)e.Value).Month - 1) / 3 + 1).ToString();
                break;
            }
        }
 protected void ASPxPivotGrid2_CustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
 {
     if (e.Field.UnboundFieldName != "fieldCompanyGroup")
     {
         return;
     }
     if (Convert.ToChar(e.Value.ToString()[0]) < 'F')
     {
         e.GroupValue = "A-E";
         return;
     }
     if (Convert.ToChar(e.Value.ToString()[0]) > 'E' && Convert.ToChar(e.Value.ToString()[0]) < 'P')
     {
         e.GroupValue = "F-O";
         return;
     }
     if (Convert.ToChar(e.Value.ToString()[0]) > 'O' && Convert.ToChar(e.Value.ToString()[0]) < 'T')
     {
         e.GroupValue = "P-S";
         return;
     }
     if (Convert.ToChar(e.Value.ToString()[0]) > 'S')
     {
         e.GroupValue = "T-Z";
     }
 }
Example #3
0
/// <summary>
/// Calculate group value from incoming data value
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

        private void Grid_CustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
        {
            PivotGridFieldContext fc = GetPivotGridFieldContext(e.Field);
            PivotGridFieldMx      f  = fc.F;
            AggregationDef        ad = f.Aggregation;

            if (e.Field.Area != PivotArea.ColumnArea && e.Field.Area != PivotArea.RowArea)
            {
                return;                 // not sure why this is happening but ignore if so
            }
            if (!ad.IsGroupingType)     // must check this since when moving a field to a grouping area in the PivotGridDialog, this event fires before the FieldAreaChanged event (true?)
            {
                return;                 // throw new Exception("Expected Group Role");
            }
            AggregationTypeDetail td = ad.TypeDetail;

            if (td.GroupingMethod == null)
            {
                return;
            }

            QueryColumn qc = fc.Qc;
            object      vo = e.Value;        // value to apply group function to

            object groupValue = td.GroupingMethod(qc, ad, vo);

            e.GroupValue = groupValue;
        }
Example #4
0
        void PivotGridControlOnCustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
        {
            var groupIntervalRules = _ruleCollector.GroupIntervalRules(e.Field, Frame);

            foreach (var intervalRule in groupIntervalRules)
            {
                intervalRule.Calculate(e);
            }
        }
Example #5
0
        private void pivotGridControl1_CustomGroupInterval(object sender,
                                                           PivotCustomGroupIntervalEventArgs e)
        {
            if (!object.ReferenceEquals(e.Field, fieldCustomerGroup))
            {
                return;
            }
            string customerName = Convert.ToString(e.Value);

            if (customerName[0] < 'F')
            {
                e.GroupValue = "A-E";
            }
            else if (customerName[0] > 'E' && customerName[0] < 'T')
            {
                e.GroupValue = "F-S";
            }
            else if (customerName[0] > 'S')
            {
                e.GroupValue = "T-Z";
            }
        }
Example #6
0
        public void Calculate(PivotCustomGroupIntervalEventArgs e)
        {
            var dateTime = ((DateTime)e.Value);

            e.GroupValue = new DateTime(dateTime.Year, dateTime.Month, 1);
        }
Example #7
0
        void IPivotGroupIntervalEvent.Calculate(PivotCustomGroupIntervalEventArgs e)
        {
            var valueAsDate = (DateTime)e.Value;

            e.GroupValue = valueAsDate >= _currentPeriodDate ? CurrentPeriod : ComparePeriod;
        }
        void pivotGrid_CustomGroupInterval(object sender, PivotCustomGroupIntervalEventArgs e)
        {
            DateTime date = (DateTime)e.Value;

            e.GroupValue = CalculateMoonPhase(date.Year, date.Month, date.Day);
        }