コード例 #1
0
        private void dashboardViewer1_DashboardItemDoubleClick(object sender, DashboardItemMouseActionEventArgs e)
        {
            XtraForm form = new XtraForm {
                Text = "Underlying Data"
            };
            DashboardUnderlyingDataSet underlyingData = e.GetUnderlyingData();

            if (underlyingData != null && underlyingData.RowCount > 0)
            {
                DevExpress.XtraGrid.GridControl grid = new DevExpress.XtraGrid.GridControl {
                    Parent     = form,
                    Dock       = DockStyle.Fill,
                    DataSource = underlyingData,
                };
            }
            else
            {
                LabelControl lbl = new LabelControl {
                    Text   = "No Data",
                    Parent = form,
                };
                lbl.AutoSizeMode = LabelAutoSizeMode.None;
                lbl.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
                lbl.Appearance.TextOptions.VAlignment = VertAlignment.Center;
                lbl.Dock = DockStyle.Fill;
            }

            form.ShowDialog();
            form.Dispose();
        }
コード例 #2
0
        private static string GetOid(DashboardItemMouseActionEventArgs e)
        {
            MultiDimensionalData data         = e.Data.GetSlice(e.GetAxisPoint());
            MeasureDescriptor    descriptor   = data.GetMeasures().SingleOrDefault(item => item.DataMember == "Oid");
            MeasureValue         measureValue = data.GetValue(descriptor);

            return(measureValue.Value.ToString());
        }
 private void dashboardViewer1_DashboardItemClick(object sender,
                                                  DashboardItemMouseActionEventArgs e)
 {
     if (e.DashboardItemName == "gridDashboardItem1" & e.GetUnderlyingData() != null)
     {
         ShowUnderlyingData(e.GetUnderlyingData());
     }
 }
コード例 #4
0
        private void Viewer_DashboardItemDoubleClick(object sender, DashboardItemMouseActionEventArgs e)
        {
            Dashboard dashboard = ((DashboardViewer)sender).Dashboard;

            if (IsGridDashboardItem(dashboard, e.DashboardItemName) &&
                openDetailViewAction.Enabled && openDetailViewAction.Active)
            {
                openDetailViewAction.DoExecute(GetOid(e));
            }
        }
コード例 #5
0
 /// <summary>
 /// Used to get dimensions' values related to a clicked area and set parameters used for filtering
 /// </summary>
 void OnDashboardItemClick(object sender, DashboardItemMouseActionEventArgs e)
 {
     if (e.DashboardItemName == "pivotDashboardItem1" && !skipFiltering)
     {
         dashboardDesigner1.BeginUpdateParameters();
         //clear all parameters
         ClearPivotFilter();
         //set selected columns and rows to parameters
         SetParameterValue(e.GetAxisPoint("Column"));
         SetParameterValue(e.GetAxisPoint("Row"));
         dashboardDesigner1.EndUpdateParameters();
     }
 }
コード例 #6
0
 private void dashboardViewer1_DashboardItemClick(object sender,
                                                  DashboardItemMouseActionEventArgs e)
 {
     if (e.DashboardItemName == "chartDashboardItem1" && e.GetAxisPoint() != null)
     {
         XtraForm form = new XtraForm();
         form.Text = e.GetAxisPoint(DashboardDataAxisNames.ChartArgumentAxis).
                     DimensionValue.Value.ToString() + " - " +
                     e.GetAxisPoint(DashboardDataAxisNames.ChartSeriesAxis).
                     DimensionValue.Value.ToString();
         DataGrid grid = new DataGrid();
         grid.Parent     = form; grid.Dock = DockStyle.Fill;
         grid.DataSource = e.GetUnderlyingData();
         form.ShowDialog();
         form.Dispose();
     }
 }
コード例 #7
0
        /// <summary>
        /// Used to get underlying data and display the DetailData dialog
        /// </summary>
        void DashboardItemClick(object sender, DashboardItemMouseActionEventArgs e)
        {
            if (IsDetailsEnabled(e.DashboardItemName))
            {
                PivotGridControl pivot = dashboardDesigner.GetUnderlyingControl(e.DashboardItemName) as PivotGridControl;
                PivotGridHitInfo hi    = pivot.CalcHitInfo(pivot.PointToClient(Cursor.Position));

                bool doNotShowDataForThisArea =
                    (hi.HitTest == PivotGridHitTest.Value && hi.ValueInfo.ValueHitTest == PivotGridValueHitTest.ExpandButton) ||
                    (hi.HitTest == PivotGridHitTest.None);
                if (!doNotShowDataForThisArea)
                {
                    using (DetailData detailForm = new DetailData(e.GetUnderlyingData()))
                    {
                        detailForm.ShowDialog();
                    }
                }
            }
        }
        // Handles the DashboardViewer.DashboardItemClick event.
        private void dashboardViewer1_DashboardItemClick(object sender,
                                                         DashboardItemMouseActionEventArgs e)
        {
            if (e.DashboardItemName == "cardDashboardItem1" & e.GetAxisPoint() != null)
            {
                // Obtains client data related to the clicked card.
                MultiDimensionalData clickedItemData = e.Data.GetSlice(e.GetAxisPoint());
                DeltaDescriptor      delta           = e.GetDeltas()[0];

                // Creates a data table that will be used to hold client data.
                DataTable dataSource = new DataTable();
                dataSource.Columns.Add("Argument", typeof(DateTime));
                dataSource.Columns.Add("Actual", typeof(double));
                dataSource.Columns.Add("Target", typeof(double));

                // Saves values of axis points placed on the "sparkline" axis and corresponding
                // actual/target values to the data table.
                foreach (AxisPoint point in
                         clickedItemData.GetAxisPoints(DashboardDataAxisNames.SparklineAxis))
                {
                    DataRow    row        = dataSource.NewRow();
                    DeltaValue deltaValue = clickedItemData.GetSlice(point).GetDeltaValue(delta);
                    if (deltaValue.ActualValue.Value != null &&
                        deltaValue.TargetValue.Value != null)
                    {
                        row["Argument"] = point.Value;
                        row["Actual"]   = deltaValue.ActualValue.Value;
                        row["Target"]   = deltaValue.TargetValue.Value;
                    }
                    else
                    {
                        row["Argument"] = DBNull.Value;
                        row["Actual"]   = DBNull.Value;
                        row["Target"]   = DBNull.Value;
                    }
                    dataSource.Rows.Add(row);
                }
                DisplayDetailedChart(GetFormTitle(clickedItemData), dataSource);
            }
        }