Skip to main content
All docs

ICustomExportControlProvider Interface

Allows you to specify a printable control that corresponds to the custom dashboard item.

Namespace: DevExpress.DashboardCommon

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

NuGet Package: DevExpress.Dashboard.Core


public interface ICustomExportControlProvider


Follow the steps below to export a custom dashboard item:

  1. Create a class that implements the ICustomExportControlProvider interface to configure a printable control that corresponds to a custom item in the dashboard.

  2. In the DashboardExporter.CustomItemExportControlCreating event handler, assign this class instance to the ExportControlProvider property to use the configured printable control for a custom dashboard item’s export.

The following example shows how use the DashboardExporter component in a console application to export a dashboard with a custom Funnel item:


View Example: BI Dashboard - Non-Visual Custom Export

Implement the ICustomExportControlProvider Interface

Create a class that implements the ICustomExportControlProvider interface (FunnelItemExportControlProvider in this example). FunnelItemExportControlProvider is used to configure the printable XRChart control for the custom Funnel item in the dashboard.

The ICustomExportControlProvider.GetPrintableControl method specifies the printable XRChart control that is used to export the custom Funnel. The method gets CustomItemExportInfo and CustomItemData objects as parameters.

The CustomItemExportInfo object contains the custom Funnel’s export settings: ExportMode and Selection.

The ChartControl.SelectionMode property is updated according to the master filter mode. The SetSelection method updates the custom control based on the current master filter selection.

The ConfigureSeries method is used to data bind and configure the custom Funnel chart’s series. The CustomItemData.GetBindings method gets a CustomItemBindingValue collection. Each object in this collection contains information about data items stored in a custom item. The object’s UniqueId property value can be used as a data member when a custom control is bound to data.

using System.Collections.Generic;
using System.Linq;
using DevExpress.DashboardCommon;
using DevExpress.XtraCharts;
using DevExpress.XtraReports.UI;

namespace DashboardExporterApp {
    public class FunnelItemExportControlProvider : ICustomExportControlProvider {
        readonly CustomDashboardItem dashboardItem;
        public FunnelItemExportControlProvider(CustomDashboardItem dashboardItem) {
            this.dashboardItem = dashboardItem;
        XRControl ICustomExportControlProvider.GetPrintableControl(CustomItemData customItemData, 
            CustomItemExportInfo exportInfo) {
            XRChart chart = new XRChart();
            chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.True;
            chart.CustomDrawSeriesPoint += CustomDrawSeriesPoint;
            DashboardFlatDataSource flatData = customItemData.GetFlatData(new DashboardFlatDataSourceOptions() {
                AddColoringColumns = true });
            ConfigureSeries(chart, customItemData, flatData, exportInfo.DrillDownValues.Count);
            SetSelection(chart, exportInfo.Selection, flatData);
            return chart;
        void ConfigureSeries(XRChart chart, CustomItemData customItemData,
            DashboardFlatDataSource flatData, int drillDownLevel) {
            Series series = new Series("A Funnel Series", ViewType.Funnel);
            IList<CustomItemBindingValue> values = customItemData.GetBindings("Value");
            IList<CustomItemBindingValue> arguments = customItemData.GetBindings("Arguments");
            if(values.Count > 0 && arguments.Count > 0) {
                series.DataSource = flatData;
                    series.ArgumentDataMember = arguments[drillDownLevel].UniqueId;
                    series.ArgumentDataMember = arguments.Last().UniqueId;
                series.ColorDataMember = flatData.GetColoringColumn(values[0].UniqueId).Name;
            ((FunnelSeriesLabel)series.Label).Position = FunnelSeriesLabelPosition.Center;
        void SetSelectionMode(XRChart chart) {
            chart.Chart.SeriesSelectionMode = SeriesSelectionMode.Point;
            switch(dashboardItem.InteractivityOptions.MasterFilterMode) {
                case DashboardItemMasterFilterMode.None:
                    chart.Chart.SelectionMode = ElementSelectionMode.None;
                case DashboardItemMasterFilterMode.Single:
                    chart.Chart.SelectionMode = ElementSelectionMode.Single;
                case DashboardItemMasterFilterMode.Multiple:
                    chart.Chart.SelectionMode = ElementSelectionMode.Extended;
                    chart.Chart.SelectionMode = ElementSelectionMode.None;
        void SetSelection(XRChart chart, CustomItemSelection selection, 
            DashboardFlatDataSource flatData) {
            foreach(DashboardFlatDataSourceRow row in selection.GetDashboardFlatDataSourceRows(flatData))
        void CustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e) {
            e.LabelText = e.SeriesPoint.Argument + " - " + e.LabelText;
            e.LegendText = e.SeriesPoint.Argument;

Handle the CustomItemExportControlCreating Event

Handle the CustomItemExportControlCreating event and assign the FunnelItemExportControlProvider object to the ExportControlProvider property. The property is used to specify the printable control that corresponds to the exported custom Funnel item.

using DevExpress.DashboardCommon;
DashboardExporter exporter = new DashboardExporter();
exporter.CustomItemExportControlCreating += Exporter_CustomItemExportControlCreating;

static void Exporter_CustomItemExportControlCreating(object sender, 
    CustomItemExportControlCreatingEventArgs e) {
    if(e.CustomItemType == "FunnelItem")
        e.ExportControlProvider = new FunnelItemExportControlProvider(e.DashboardItem);
See Also