示例#1
0
        /// <summary>
        /// Duplicate an existing field
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void DuplicatePivotField_Click(object sender, EventArgs e)
        {
            int[] rows = FieldGridView.GetSelectedRows();
            if (rows.Length == 0)
            {
                return;
            }

            PivotGrid.BeginUpdate();
            object ds = PivotGrid.DataSource;

            PivotGrid.DataSource = null;

            PivotGridFieldMx f = PivotGrid.Fields[rows[0]] as PivotGridFieldMx;

            if (f == null)
            {
                return;
            }

            PivotGridFieldMx f2 = new PivotGridFieldMx();

            f.CopyField(f2);
            PivotGrid.Fields.Add(f2);

            PivotGrid.DataSource = ds;
            PivotGrid.EndUpdate();

            FillFieldDetailsGrid();
            return;
        }
示例#2
0
/// <summary>
/// Show the panel
/// </summary>
/// <param name="f"></param>
/// <param name="location"></param>

        public void Show(
            PivotGridFieldMx f,
            Point location,
            PivotGridDialog dialog)
        {
            string txt;

            Field     = f;
            FieldCopy = new PivotGridFieldMx();
            f.CopyField(FieldCopy);
            PgDlg = dialog;

            Control c = NoInterval;

            IntervalBinCount.Text          =
                FixedIntervalSize.Text     =
                    VariableIntervals.Text = "";

            //if (f.GroupIntervalMx == GroupBinType.FixedIntervalCount)
            //{
            //	//FixedIntervalCountOption.Checked = true;
            //	//txt = f.GroupIntervalCount.ToString();
            //	//if (f.GroupIntervalCount <= 0) txt = "3";
            //	//IntervalBinCount.Text = txt;
            //	//c = IntervalBinCount;
            //}

            //else if (f.GroupIntervalMx == GroupBinType.FixedIntervalSize)
            //{
            //	//FixedIntervalSizeOption.Checked = true;

            //	//txt = f.GroupIntervalSize.ToString();
            //	//if (f.GroupIntervalCount <= 0) txt = "100";
            //	//FixedIntervalSize.Text = txt;
            //	//c = FixedIntervalSize;
            //}

            //else if (f.GroupIntervalMx == GroupBinType.VariableIntervals)
            //{
            //	//VariableIntervalsOption.Checked = true;
            //	//VariableIntervals.Text = f.GroupVariableIntervals;
            //	//c = VariableIntervals;
            //}

            //else
            //{
            //	NoInterval.Checked = true;
            //	c = NoInterval;
            //}

            Location = location;
            Show();
            c.Focus();
            return;
        }
示例#3
0
/// <summary>
/// Add a new pivot grid field
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>

        private void AddPivotField_Click(object sender, EventArgs e)
        {
            QueryManager qm = PivotView.Qm;
            Query        q  = qm.Query;

            FieldSelectorControl.Query      = q;
            FieldSelectorControl.MetaColumn = null;
            Point p = AddPivotField.PointToScreen(new Point(0, AddPivotField.Height));

            Mobius.Data.QueryColumn qc = FieldSelectorControl.ShowMenu(p);
            if (qc == null)
            {
                return;
            }

            PivotGridPropertiesMx pp = PivotView.PivotGridPropertiesMx;

            ResultsField rfld = qm.ResultsFormat.GetResultsField(qc);

            if (rfld == null)
            {
                return;
            }

            PivotGridFieldMx field =             // add new field (must add to base view)
                                     PivotGridView.AddField(rfld, pp.PivotFields, null, GroupingTypeEnum.EqualValues);

            PivotGridFieldMx field2 = new PivotGridFieldMx();

            field.CopyField(field2);
            pp.PivotFields.Remove(field);             // remove from base view

            PivotGrid.BeginUpdate();
            object ds = PivotGrid.DataSource;

            PivotGrid.DataSource = null;
            PivotGrid.Fields.Add(field2);             // add to pivot grid
            PivotView.ConfigurePivotGridControlField(field2);
            PivotGrid.DataSource = ds;
            PivotGrid.EndUpdate();

            FillFieldDetailsGrid();
            return;
        }
示例#4
0
/// <summary>
/// Build the Grid fields for the PivotGridControl from the persisted Mobius view fields
/// </summary>

        void BuildGridFieldsFromViewFields()
        {
            PivotGridFieldMx gf, gf2;

            PivotGridCtl.Fields.Clear();
            PivotGridCtl.Groups.Clear();

            PivotGridPropertiesMx p = PivotGridPropertiesMx;

            for (int fi = 0; fi < p.PivotFields.Count; fi++)             // build grid fields from view fields
            {
                PivotGridFieldMx pf   = p.PivotFields[fi];
                ResultsField     rfld = pf.ResultsField as ResultsField;
                if (rfld == null)
                {
                    continue;
                }
                PivotGridControlMx.SetFieldCaption(pf);                 // be sure we have a caption

                Mobius.Data.QueryColumn qc = rfld.QueryColumn;
                MetaColumn mc = rfld.MetaColumn;

                gf = new PivotGridFieldMx();
                pf.CopyField(gf);
                pf.SyncDxAreaToMxRole();

                if (mc.IsKey)
                {
                    gf.ImageIndex = (int)Bitmaps16x16Enum.Key;
                }
                else
                {
                    gf.ImageIndex = (int)mc.DataTypeImageIndex;
                }

                gf.Options.AllowRunTimeSummaryChange = true;
                gf.Options.ShowUnboundExpressionMenu = true;

                PivotGridCtl.Fields.Add(gf);
            }

            return;
        }
示例#5
0
        /// <summary>
        /// Show the panel
        /// </summary>
        /// <param name="f"></param>
        /// <param name="location"></param>

        public void Show(
            PivotGridFieldMx f,
            Point location,
            PivotGridDialog dialog)
        {
            string txt;

#if false
            Field     = f;
            FieldCopy = new PivotGridFieldMx();
            f.CopyField(FieldCopy);
            PgDlg = dialog;

            Control c;
            IntervalBinCount.Text          =
                FixedIntervalSize.Text     =
                    VariableIntervals.Text = "";

            if (f.GroupIntervalMx == PivotGroupIntervalMx.FixedIntervalCount)
            {
                FixedIntervalCountOption.Checked = true;
                txt = f.GroupIntervalCount.ToString();
                if (f.GroupIntervalCount <= 0)
                {
                    txt = "3";
                }
                IntervalBinCount.Text = txt;
                c = IntervalBinCount;
            }

            else if (f.GroupIntervalMx == PivotGroupIntervalMx.FixedIntervalSize)
            {
                FixedIntervalSizeOption.Checked = true;

                txt = f.GroupIntervalSize.ToString();
                if (f.GroupIntervalCount <= 0)
                {
                    txt = "100";
                }
                FixedIntervalSize.Text = txt;
                c = FixedIntervalSize;
            }

            else if (f.GroupIntervalMx == PivotGroupIntervalMx.VariableIntervals)
            {
                VariableIntervalsOption.Checked = true;
                VariableIntervals.Text          = f.GroupVariableIntervals;
                c = VariableIntervals;
            }

            else
            {
                NoInterval.Checked = true;
                c = NoInterval;
            }

            Location = location;
            Show();
            c.Focus();
            return;
#endif
        }
示例#6
0
 private void CancelBut_Click(object sender, EventArgs e)
 {
     FieldCopy.CopyField(Field);             // restore any changed values
     Hide();
 }
示例#7
0
 private void NumericIntervalPanelCancel_Click(object sender, EventArgs e)
 {
     FieldCopy.CopyField(Field);             // restore any changed values
     Hide();
 }