Skip to main content
All docs
V25.2
  • TdxCustomDashboardControl.ExportToCSV(TStream) Method

    Exports dashboard content to a stream in the comma-separated values (CSV) format.

    Declaration

    procedure ExportToCSV(AStream: TStream);

    Parameters

    Name Type Description
    AStream TStream

    The target stream.

    Remarks

    Call the ExportToCSV procedure to export dashboard content to a stream in the CSV format.

    The ExportTimeout property allows you to set a timeout interval (in milliseconds) for export operations. If the specified export timeout is reached, an exception is thrown.

    Code Example: Export Dashboard Content to a CSV File

    The following code example exports content of a configured TdxDashboardControl component to a file in the CSV format using an intermediary TMemoryStream object:

    uses
      dxDashboard.Control,  // Declares the TdxDashboardControl component
      dxShellDialogs;       // Declares the TdxSaveFileDialog component
    // ...
    
    procedure TMyForm.cxButtonExportToCSVClick(Sender: TObject);
    var
      AStream: TMemoryStream;
    begin
      if not dxSaveFileDialog1.Execute(Handle) then Exit; // Displays the "Save File" dialog
      AStream := TMemoryStream.Create;   // Creates a stream as an intermediary container
      try
        dxDashboardControl1.ExportToCSV(AStream);       // Exports content to a stream in the CSV format
        AStream.SaveToFile(dxSaveFileDialog1.FileName);   // Saves CSV stream content to a file
      finally
        AStream.Free;                    // Releases the intermediary memory stream
      end;
    end;
    

    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\

    Other Export Methods

    You can call the following procedures to export dashboard content to a stream in other formats:

    ExportTo
    Exports dashboard content to a stream in any supported format.
    ExportToGIF
    Exports dashboard content to a stream in the Graphics Interchange Format (GIF).
    ExportToJPG
    Exports dashboard content in the JPEG format.
    ExportToPDF
    Exports dashboard content to a stream in the Portable Document Format (PDF).
    ExportToPNG
    Exports dashboard content to a stream in the Portable Network Graphics (PNG) format.
    ExportToSVG
    Exports dashboard content to a stream in the Scalable Vector Graphics (SVG) format.
    ExportToXLS
    Exports dashboard content to a stream in the Microsoft Excel® binary format (XLS).
    ExportToXLSX
    Exports dashboard content to a stream in the Office OpenXML Spreadsheet Format (XLSX).
    See Also