Skip to main content
All docs
V26.1
  • TdxCustomReportControl.ExportToCSV(string) Method

    Exports report content to a file in the comma-separated values (CSV) format.

    Declaration

    procedure ExportToCSV(const AFileName: string); overload;

    Parameters

    Name Type Description
    AFileName string

    An absolute or relative path to the target file.

    Remarks

    Call the ExportToCSV procedure to export report content to a file in the CSV format.

    Code Example: Export Report Content to CSV File

    The following code example exports content of a configured TdxReportControl component to a file in the comma-separated values (CSV) format:

    uses
      dxReport.Control,  // Declares the TdxReportControl component
      dxShellDialogs;    // Declares the TdxSaveFileDialog component
    // ...
    
    procedure TMyForm.cxButtonExportToCSVClick(Sender: TObject);
    begin
      if not dxSaveFileDialog1.Execute(Handle) then Exit;  // Displays the "Save File" dialog
      dxReportControl1.ExportToCSV(dxSaveFileDialog1.FileName);  // Saves control content to a file
    end;
    

    To see the report export functionality in action, run the Report 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\ExpressReports\

    Other Export Methods

    Export to File

    ExportTo
    Exports report content to a file in any supported format.
    ExportToDOCX
    Exports report content to a file in the Office OpenXML Document (DOCX) format.
    ExportToHTML
    Exports report content to a file in the HyperText Markup Language (HTML) document format.
    ExportToImage

    Exports report content to a file in the current image export format (selected using the Report Designer dialog).

    The default image export format is PNG (Portable Network Graphics).

    ExportToMHT
    Exports report content to a file in the MIME HTML (MHT) document format.
    ExportToPDF
    Exports report content to a file in the Portable Document (PDF) format.
    ExportToRTF
    Exports report content to a file in the Rich Text (RTF) document format.
    ExportToText
    Exports report content to a file in the plain text (TXT) format.
    ExportToXLS
    Exports report content to a file in the Microsoft Excel® binary (XLS) format.
    ExportToXLSX
    Exports report content to a file in the Office OpenXML Spreadsheet (XLSX) format.
    SaveDocument
    Exports report content to a file in the XML-Based Report Archive (PRNX) format.

    Export to Stream

    ExportTo
    Exports report content to a stream in any supported format.
    ExportToCSV
    Exports report content to a stream in the comma-separated values (CSV) format.
    ExportToDOCX
    Exports report content to a stream in the Office OpenXML Document (DOCX) format.
    ExportToHTML
    Exports report content to a stream in the HyperText Markup Language (HTML) document format.
    ExportToImage

    Exports report content to a stream in the current image export format (selected using the Report Designer dialog).

    The default image export format is PNG (Portable Network Graphics).

    ExportToMHT
    Exports report content to a stream in the MIME HTML (MHT) document format.
    ExportToPDF
    Exports report content to a stream in the Portable Document (PDF) format.
    ExportToRTF
    Exports report content to a stream in the Rich Text (RTF) document format.
    ExportToText
    Exports report content to a stream in the plain text (TXT) format.
    ExportToXLS
    Exports report content to a stream in the Microsoft Excel® binary (XLS) format.
    ExportToXLSX
    Exports report content to a stream in the Office OpenXML Spreadsheet (XLSX) format.
    SaveDocument
    Exports report content to a stream in the XML-Based Report Archive (PRNX) format.
    See Also