DevExpress Dashboard – Custom Export

As you may already know, DevExpress BI Dashboard ships with numerous export settings/customization options. In this post, I’ll describe recent enhancements made to our Dashboard’s data export engine. Should you have any questions about these new features (or any other Dashboard-related question), please post your comments below.

Based on customer feedback, v20.1 and v20.2 shipped with the following Dashboard export enhancements:

  • Extension of our export customization API.
  • Use of XRControls (reporting controls) to export most used/popular Dashboard items.

Custom Export Customization API

Because DevExpress Dashboard ships with advanced customization options, your end-users may wish to display or export customized Dashboard settings within output documents/exported files. Our export customization API was enhanced to address this usage scenario.

To customize your output document, you must use DevExpress Dashboard’s DashboardControl.CustomExport event. This event’s data class exposes CustomExportEventArgs.GetPrintableControl and CustomExportEventArgs.GetPrintableControls methods (to help obtain printable controls).

As I mentioned earlier, we extended the customization-related capabilities of individual dashboard items during export. You can now maintain customization settings applied to XRControls . v20.1 included support for the Chart, Scatter Chart, Range filter and Gauge dashboard items. In v20.2 we extended support for the Pie item.

Let me quickly describe how this works. Assume I have a Pie dashboard item with customized totals in my WinForms Dashboard. If I use the standard export option, the export engine will produce the following result:

As you can see, the exported Pie item only contains default settings.

Ok - now to my example. Let me handle the DashboardDesigner.CustomExport event and obtain the printable control via the CustomExportEventArgs.GetPrintableControls method:

using DevExpress.DashboardCommon; 
using DevExpress.DashboardWin; 
using DevExpress.XtraCharts; 
using DevExpress.XtraReports.UI; 
using System.Windows.Forms; 
private void dashboardDesigner1_CustomExport(object sender, CustomExportEventArgs e) { 
	foreach (var printControl in e.GetPrintableControls()) { 
		if (printControl.Value is XRChart) {
			var pieItemName = printControl.Key;
			IDashboardControl dashboardControl = (IDashboardControl)sender; 
			PieDashboardItem pieDashboardItem = dashboardControl.Dashboard.Items[pieItemName] as PieDashboardItem; 
			if (pieDashboardItem == null) return; 
			XRChart pieChart = printControl.Value as XRChart; 
			foreach (Series series in pieChart.Series) { 
				(series.View as PieSeriesView).TotalLabel.Visible = true; 
				(series.View as PieSeriesView).TotalLabel.TextPattern = "Total {TV:c0}"; 

Since this event fires during export, my new export document will correctly render the Pie item.

This new dashboard export customization API is available for WinForms, WPF and our Web Dashboard Controls.


Your feedback matters - please take a moment to answer the following question.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.