The requested page is not available for the requested platform. You are viewing the content for Default platform.

PivotDashboardItem Class

A Pivot dashboard item that displays cross-tabular reports.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v19.1.Core.dll

Declaration

public class PivotDashboardItem :
    DataDashboardItem,
    IPivotDashboardItem
Public Class PivotDashboardItem
    Inherits DataDashboardItem
    Implements IPivotDashboardItem

Remarks

The Pivot dashboard item presents data using cross-tabular reports.

MainFeatures_PivotGrid

The following documentation is available.

Examples

The following example demonstrates how to bind a Pivot dashboard item to data in code.

using System;
using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DataAccess;

namespace Dashboard_CreatePivot {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        private PivotDashboardItem CreatePivot(DashboardObjectDataSource dataSource) {

            // Creates a pivot dashboard item and specifies its data source.
            PivotDashboardItem pivot = new PivotDashboardItem();
            pivot.DataSource = dataSource;

            // Specifies dimensions that provide pivot column and row headers.
            pivot.Columns.AddRange(new Dimension("Country"), new Dimension("Sales Person"));
            pivot.Rows.AddRange(new Dimension("CategoryName"), new Dimension("ProductName"));

            // Specifies measures whose data is used to calculate pivot cell values.
            pivot.Values.AddRange(new Measure("Extended Price"), new Measure("Quantity"));

            // Specifies the default expanded state of pivot column field values.
            pivot.AutoExpandColumnGroups = true;

            return pivot;
        }
        private void Form1_Load(object sender, EventArgs e) {

            // Creates a dashboard and sets it as the currently opened dashboad in the dashboard viewer.
            dashboardViewer1.Dashboard = new Dashboard();

            // Creates a data source and adds it to the dashboard data source collection.
            DashboardObjectDataSource dataSource = new DashboardObjectDataSource();
            dataSource.DataSource = (new nwindDataSetTableAdapters.SalesPersonTableAdapter()).GetData();
            dashboardViewer1.Dashboard.DataSources.Add(dataSource);

            // Creates a pivot dashboard item with the specified data source 
            // and adds it to the Items collection, to display it within the dashboard.
            PivotDashboardItem pivot = CreatePivot(dataSource);
            dashboardViewer1.Dashboard.Items.Add(pivot);

            // Reloads data in the data sources.
            dashboardViewer1.ReloadData();
        }
    }
}

Inheritance

Implements

DevExpress.DashboardCommon.Native.IDashboardComponent
DevExpress.DashboardCommon.Native.IChangeService
DevExpress.DataAccess.Native.ISupportPrefix
DevExpress.DashboardCommon.Native.ICurrencyCultureNameProvider
DevExpress.DashboardCommon.Native.IFiltersProvider
DevExpress.DashboardCommon.Native.ISliceDataQueryProvider
DevExpress.DashboardCommon.Native.IDimensionAxes
DevExpress.DashboardCommon.Native.IMasterFilter
DevExpress.DashboardCommon.Native.IMasterFilterItem
DevExpress.DashboardCommon.Native.IDataItemRepositoryProvider
DevExpress.DashboardCommon.Native.IDataSourceSchemaProvider
DevExpress.DashboardCommon.Native.IDataItemContainerContext
DevExpress.DashboardCommon.Native.IDataItemContext
DevExpress.DashboardCommon.Native.IFormatOwnerContext
DevExpress.DashboardCommon.Native.IColorSchemeContext
DevExpress.DashboardCommon.Native.IFormatRulesContext
DevExpress.DashboardCommon.Native.IInteractivityOptionsProvider
DevExpress.DashboardCommon.Native.IPivotDashboardItem
See Also