/// <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();
     }
 }
Ejemplo n.º 2
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();
     }
 }
Ejemplo n.º 3
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());
        }
        // 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);
            }
        }