Skip to main content
All docs
V25.2
  • Dashboard Export

    • 4 minutes to read

    The VCL BI Dashboards Solution for data analytics (TdxDashboard/TdxDashboardControl) allows you to export dashboard content to a file or stream (in a format of your choice: PDF, XLSX, CSV, PNG, JPG, etc.).

    VCL Dashboards: An "Export Formats" Menu Example in the Dashboard Viewer Dialog

    Dashboard Export APIs

    This section lists all export methods declared in TdxDashboard and TdxDashboardControl classes.

    Tip

    Refer to individual method descriptions for detailed information and code examples.

    Image Format-Specific Export Methods

    TdxDashboardControl.ExportToGIF(TStream) | TdxDashboardControl.ExportToGIF(String) TdxDashboard.ExportToGIF(TStream) | TdxDashboard.ExportToGIF(String)
    Export dashboard content to a file or stream in the Graphics Interchange Format (GIF).
    TdxDashboardControl.ExportToJPG(TStream) | TdxDashboardControl.ExportToJPG(String) TdxDashboard.ExportToJPG(TStream) | TdxDashboard.ExportToJPG(String)
    Export dashboard content to a file or stream in the Joint Photographic Experts Group (JPEG/JPG) format.
    TdxDashboardControl.ExportToPNG(TStream) | TdxDashboardControl.ExportToPNG(String) TdxDashboard.ExportToPNG(TStream) | TdxDashboard.ExportToPNG(String)
    Export dashboard content to a file or stream in the Portable Network Graphics (PNG) format.
    TdxDashboardControl.ExportToSVG(TStream) | TdxDashboardControl.ExportToSVG(String) TdxDashboard.ExportToSVG(TStream) | TdxDashboard.ExportToSVG(String)
    Export dashboard content to a file or stream in the Scalable Vector Graphics (SVG) format.

    PDF Export Methods

    TdxDashboardControl.ExportToPDF(TStream) | TdxDashboardControl.ExportToPDF(String) TdxDashboard.ExportToPDF(TStream) | TdxDashboard.ExportToPDF(String)
    Export dashboard content to a file or stream in the Portable Document Format (PDF).

    Spreadsheet Format Export Methods

    TdxDashboardControl.ExportToCSV(TStream) | TdxDashboardControl.ExportToCSV(String) TdxDashboard.ExportToCSV(TStream) | TdxDashboard.ExportToCSV(String)
    Export dashboard content to a file or stream in the comma-separated values (CSV) format.
    TdxDashboardControl.ExportToXLS(TStream) | TdxDashboardControl.ExportToXLS(String) TdxDashboard.ExportToXLS(TStream) | TdxDashboard.ExportToXLS(String)
    Export dashboard content to a file or stream in the Microsoft Excel® binary (XLS) format.
    TdxDashboardControl.ExportToXLSX(TStream) | TdxDashboardControl.ExportToXLSX(String) TdxDashboard.ExportToXLSX(TStream) | TdxDashboard.ExportToXLSX(String)
    Export dashboard content to a file or stream in the Office OpenXML Spreadsheet (XLSX) format.

    Universal Export Methods

    ExportTo(TdxDashboardExportFormat,TStream) | ExportTo(TdxDashboardExportFormat,TStream,string) | ExportTo(TdxDashboardExportFormat,string)
    Export the TdxDashboardControl component’s current content to a file or stream in any supported format.
    ExportTo(TdxDashboardExportFormat,TStream) | ExportTo(TdxDashboardExportFormat,TStream,string) | ExportTo(TdxDashboardExportFormat,string)
    Export the TdxDashboard object’s current content to a file or stream in any supported format.

    End-User Dashboard Export Functionality

    Users can click the Export To button for an individual dashboard item or an entire dashboard to export corresponding content to a document or image file:

    VCL Dashboards: "Export To" Buttons in the Dashboard Viewer Dialog

    “Export To” Menu and Format Groups

    The TdxDashboardUIExportFormat type enumerates export format groups displayed when a user clicks an Export To button within the TdxDashboardControl or the Dashboard Viewer dialog:

    VCL Dashboards: An "Export Formats" Menu Example in the Dashboard Viewer Dialog

    “Export To” Dialog

    A click on a menu item displays the corresponding modal dialog designed to select the required format and associated export settings:

    VCL Dashboards: Image Export Settings

    A click on the Export button in the Export To dialog raises the OnExport event.

    You can handle this event to execute custom code in response to a dashboard content export operation, modify the export target, replace the built-in Save As dialog, or prevent the operation depending on specific conditions in your application.

    Note

    Dashboard export methods never raise the OnExport event.

    Code Examples

    Export Dashboard Content to PNG File

    The following code example exports content of a configured TdxDashboardControl component to a file in the PNG format:

    uses
      dxDashboard.Control,  // Declares the TdxDashboardControl component
      dxShellDialogs;       // Declares the TdxSaveFileDialog component
    // ...
    
    procedure TMyForm.cxButtonExportToPNGClick(Sender: TObject);
    begin
      if not dxSaveFileDialog1.Execute(Handle) then Exit; // Displays the "Save File" dialog
      dxDashboardControl1.ExportToPNG(dxSaveFileDialog1.FileName);  // Saves the dashboard control to a file
    end;
    
    View Example: Generate Dashboards in a Backend/Service Application

    This example bypasses the DevExpress Dashboard Viewer dialog and generates a dashboard using the DevExpress Dashboards backend. You can use the demonstrated technique to implement REST/Web API backends, Windows Services, workflows, and scheduled jobs for the following usage scenarios:

    • Bulk export dashboards to PDF, DOCX, image, and other formats.
    • Share, email, and print dashboard documents without user interaction.
    • Implement custom dashboard management UIs.

    To see the dashboard export functionality in action, run the BI Dashboards Designer/Viewer demo in the VCL Demo Center installed with compiled DevExpress VCL demos. Select any demo in the sidebar on the left, click the Export button, and use any export option listed in the menu.

    Download: Compiled VCL Demos

    Tip

    You can find full source code for the installed compiled Report demo in the following folder:

    %PUBLIC%\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressDashboards\

    See Also