Skip to main content

WebDashboardExporter Class

Implements a base functionality to perform server-side export of a dashboard/dashboard item displayed in the Web Dashboard.

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v23.1.Web.dll

NuGet Package: DevExpress.Web.Dashboard.Common


public class WebDashboardExporter :


The WebDashboardExporter class provides a base export functionality and allows you to implement server export for the ASP.NET MVC Dashboard extension. You can specify a dashboard state and export options to be applied in the resulting document.

If you are using the DashboardConfigurator‘s API, pass its default instance to the WebDashboardExporter constructor.

using DevExpress.DashboardWeb;
WebDashboardExporter exporter = new WebDashboardExporter(DashboardConfigurator.Default);

Then, use the required method exposed by WebDashboardExporter to export a dashboard or dashboard item (such as WebDashboardExporter.ExportToPdf or WebDashboardExporter.ExportDashboardItemToImage).

Use the following classes to perform server-side export for other platforms:


This example demonstrates how to export a dashboard displayed using the ASP.NET MVC Dashboard extension on the server side using the WebDashboardExporter class. The following API is used to implement this capability:

View Example

using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using System;
using System.IO;
using System.Web.Mvc;

namespace MvcDashboard_ServerExport.Controllers {
    public class HomeController : Controller {
        public ActionResult Index() {
            return View();

        public ActionResult ExportDashboardToPdf(string DashboardID, string DashboardState) {
            using (MemoryStream stream = new MemoryStream()) {
                string dashboardID = DashboardID;
                DashboardState dashboardState = new DashboardState();

                DashboardPdfExportOptions pdfOptions = new DashboardPdfExportOptions();
                pdfOptions.ExportFilters = true;
                pdfOptions.DashboardStatePosition = DashboardStateExportPosition.Below;

                string dateTimeNow = DateTime.Now.ToString("yyyyMMddHHmmss");
                string filePath = "~/App_Data/Export/" + dashboardID + "_" + dateTimeNow + ".pdf";
                ASPxDashboardExporter exporter = new ASPxDashboardExporter(DashboardConfigurator.Default);
                exporter.ExportToPdf(dashboardID, stream, new System.Drawing.Size(1024, 768), dashboardState, pdfOptions);
                SaveFile(stream, filePath);

                ContentResult result = new ContentResult();
                result.Content = filePath;
                return result;

        private void SaveFile(MemoryStream stream, string path) {
            var fileStream = System.IO.File.Create(Server.MapPath(path));
function onBeforeRender(sender) {
    var control = sender.getDashboardControl();
    control.registerExtension(new DevExpress.Dashboard.DashboardPanelExtension(control));
        text: "Export to PDF",
        onClick: function (param) {
            var dashboardID = control.dashboardContainer().id;
            var dashboardStateJson = control.dashboard().state();

                url: 'Home/ExportDashboardToPdf',
                data: {
                    DashboardID: dashboardID,
                    DashboardState: JSON.stringify(dashboardStateJson)
                type: 'POST',
            }).success(function (result) {
                DevExpress.ui.notify('A dashboard was exported to ' + result, 'success', 5000);
See Also