コード例 #1
0
ファイル: StepWipView.cs プロジェクト: yichunbong/CSOT
 private void pivotGridControl1_CellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
 {
     if (e.GetFieldValue(e.DataField) != null && e.GetFieldValue(e.DataField).ToString() == "0")
     {
         e.DisplayText = string.Empty;
     }
 }
コード例 #2
0
ファイル: ShiftLogsReport.cs プロジェクト: EliasTous/ERP
        private void xrPivotGrid1_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
        {
            e.GetFieldValue(fieldemployeeName1);
            if (e.RowValueType == PivotGridValueType.Total && e.ColumnIndex == 0)
            {
                //e.DisplayText =time(items.Where(x => x.employeeName == e.GetFieldValue(fieldemployeeName1).ToString()).Sum(x => x.duration),true);
                if (_lang == "ar")
                {
                    e.DisplayText = time(items.Where(x => x.employeeName == e.GetFieldValue(fieldemployeeName1).ToString() && x.shiftId == "فترة   1").Sum(x => x.duration), true);
                }
                else if (_lang == "en")
                {
                    e.DisplayText = time(items.Where(x => x.employeeName == e.GetFieldValue(fieldemployeeName1).ToString() && x.shiftId == "shift  1").Sum(x => x.duration), true);
                }
                else if (_lang == "fr")
                {
                    e.DisplayText = time(items.Where(x => x.employeeName == e.GetFieldValue(fieldemployeeName1).ToString() && x.shiftId == "Horraire  1").Sum(x => x.duration), true);
                }

                return;
            }
            if (e.RowValueType == PivotGridValueType.Total)
            {
                e.DisplayText = "";
            }
        }
 void pivotGridControl1_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
 {
     if (e.DataField != fieldRank)
     {
         return;
     }
     e.DisplayText = "";
     if (e.RowValueType == PivotGridValueType.GrandTotal || e.Value == null)
     {
         return;
     }
     if (e.ColumnValueType == PivotGridValueType.GrandTotal)
     {
         e.DisplayText = (totalSales.IndexOf(Convert.ToDecimal(e.Value)) + 1).ToString();
         return;
     }
     else
     {
         List <decimal> sales;
         if (salesPerYear.TryGetValue((int)e.GetFieldValue(fieldYear), out sales))
         {
             e.DisplayText = (sales.IndexOf(Convert.ToDecimal(e.Value)) + 1).ToString();
         }
     }
 }
コード例 #4
0
        private void pivotGridControl1_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
        {
            PivotGridControl pivot = sender as PivotGridControl;

            if (e.DataField == fieldPercent)
            {
                List <object> rowValues = new List <object>();
                foreach (PivotGridField field in e.GetRowFields())
                {
                    rowValues.Add(UpdateValue(field, e.RowIndex, e));
                }
                List <object> columnValues = new List <object>();
                foreach (PivotGridField field in e.GetColumnFields())
                {
                    columnValues.Add(UpdateValue(field, e.ColumnIndex, e));
                }
                object previousValue = e.GetCellValue(columnValues.ToArray(), rowValues.ToArray(), e.DataField);
                if (previousValue == null)
                {
                    e.DisplayText = string.Empty;
                }
                else if (Convert.ToDecimal(previousValue) == 0)
                {
                    e.DisplayText = "err";
                }
                else
                {
                    e.DisplayText = (Convert.ToDecimal(e.Value) / Convert.ToDecimal(previousValue) - 1).ToString("P");
                }
            }
        }
コード例 #5
0
 private void onCustomCellDisplayText(PivotCellDisplayTextEventArgs e)
 {
     if (e.DataField != ValueField)
     {
         return;
     }
     e.DisplayText = _formatter.Format(e.Value);
 }
コード例 #6
0
ファイル: PivotGridController.cs プロジェクト: scsi110/eXpand
        void PivotGridControlOnCustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
        {
            var point       = new Point(e.ColumnIndex, e.RowIndex);
            var formatInfos = _ruleCollector.FormatInfos(point, PivotArea.DataArea);
            var displayText = formatInfos.Select(info => info.GetDisplayText(e.Value)).LastOrDefault();

            if (displayText != null)
            {
                e.DisplayText = displayText;
            }
        }
コード例 #7
0
 object[] GetFieldValues(PivotGridField[] fields, PivotCellDisplayTextEventArgs e, int level)
 {
     if (fields.Length < level)
     {
         return(null);
     }
     object[] values = new object[fields.Length - level];
     for (int i = 0; i < values.Length; i++)
     {
         values[i] = e.GetFieldValue(fields[i]);
     }
     return(values);
 }
コード例 #8
0
        private object UpdateValue(PivotGridField field, int index, PivotCellDisplayTextEventArgs e)
        {
            Object value = e.GetFieldValue(field, index);

            if (field == fieldOrderDate)
            {
                int currentPosition = YearValues.IndexOf(value);
                if (currentPosition > 0)
                {
                    value = YearValues[currentPosition - 1];
                }
                else
                {
                    value = "0000";
                }
            }
            ;
            return(value);
        }
コード例 #9
0
 protected void CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
 {
     if (e.RowValueType != PivotGridValueType.GrandTotal ||
         e.ColumnValueType == PivotGridValueType.GrandTotal)
     {
         return;
     }
     if (Convert.ToSingle(e.Value) < 50000)
     {
         e.DisplayText = "Low";
     }
     else if (Convert.ToSingle(e.Value) > 100000)
     {
         e.DisplayText = "High";
     }
     else
     {
         e.DisplayText = "Middle";
     }
 }
コード例 #10
0
 private void pivotGridControl1_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
 {
     if (e.DataField.Name == "fieldVariation")
     {
         Object nextValue = e.GetNextColumnCellValue(e.DataField);
         if (nextValue == null)
         {
             e.DisplayText = string.Empty;
             return;
         }
         decimal current = Convert.ToDecimal(e.Value);
         decimal next    = Convert.ToDecimal(nextValue);
         if (next == 0)
         {
             e.DisplayText = "100%";
             return;
         }
         current       = (current - next) / next;
         e.DisplayText = current.ToString("P");
     }
 }
コード例 #11
0
 private void pivotGridControl1_CustomCellDisplayText(object sender,
                                                      PivotCellDisplayTextEventArgs e)
 {
     if (e.RowValueType != FieldValueType.GrandTotal ||
         e.ColumnValueType == FieldValueType.GrandTotal ||
         e.ColumnValueType == FieldValueType.Total)
     {
         return;
     }
     if (Convert.ToSingle(e.Value) < 4000)
     {
         e.DisplayText = "Low";
     }
     else if (Convert.ToSingle(e.Value) > 5000)
     {
         e.DisplayText = "High";
     }
     else
     {
         e.DisplayText = "Middle";
     }
 }
コード例 #12
0
        /// <summary>
        /// Customize the display text for the cells displayed within the Data Area.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Grid_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
        {
            string txt;

            QualifiedNumber qn = e.Value as QualifiedNumber;             // summary values should be QNs

            if (qn == null)
            {
                return;
            }

            PivotGridFieldContext f = GetPivotGridFieldContext(e.DataField);

            AggregationTypeDetail atd = f.Aggregation.TypeDetail;

            if (atd == null || !atd.FractionalSummaryResult)
            {
                return;                                                          // just return if not numeric type
            }
            if (qn.IsNull)
            {
                e.DisplayText = "";
                return;
            }

            ColumnFormatEnum displayFormat = f.Qc.ActiveDisplayFormat;
            int decimals = f.Qc.ActiveDecimals;

            if (f.Mc.DataType == MetaColumnType.Integer)
            {
                displayFormat = ColumnFormatEnum.Decimal;
                decimals      = 1;
            }

            txt           = qn.Format(f.Qc, false, displayFormat, decimals, QnfEnum.Combined | QnfEnum.NValue, OutputDest.WinForms);
            e.DisplayText = txt;
            return;
        }
コード例 #13
0
 private void pivotGridControl1_CustomCellDisplayText(object sender, PivotCellDisplayTextEventArgs e)
 {
     if (e.Value == null || HelpNumber.ParseDecimal(e.Value) == 0)
     {
         e.DisplayText = "-";
     }
 }