Skip to main content
All docs
V26.1
  • TdxCustomReportControl.ExportToXLSX(TStream) Method

    Exports report content to a stream in the Office OpenXML Spreadsheet (XLSX) format.

    Declaration

    procedure ExportToXLSX(AStream: TStream); overload;

    Parameters

    Name Type Description
    AStream TStream

    The target stream.

    Remarks

    Call the ExportToXLSX procedure to export report content to a stream in the XLSX format.

    Code Example: Export Report Content to XLSX File

    The following code example exports content of a configured TdxReportControl component to a file in the Office OpenXML Spreadsheet (XLSX) format using an intermediary TMemoryStream object:

    uses
      dxReport.Control,  // Declares the TdxReportControl component
      dxSplashForms,     // Declares the TdxSplashFormManager class and related types
      dxShellDialogs;    // Declares the TdxSaveFileDialog component
    // ...
    
    procedure TMyForm.cxButtonExportToXLSXClick(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
      // Displays a Wait Form before the export operation
      TdxSplashFormManager.WaitForm.Show(dxReportControl1.Parent);
      try
        dxReportControl1.ExportToXLSX(AStream);   // Exports content to a stream in the XLSX format
        AStream.SaveToFile(dxSaveFileDialog1.FileName);    // Saves XLSX stream content to a file
      finally
        AStream.Free;                        // Releases the intermediary memory stream
        TdxSplashFormManager.WaitForm.Hide;  // Hides the Wait Form once the operation is complete
      end;
    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 (DOCX) document 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) document format.
    ExportToXLS
    Exports report content to a stream in the Microsoft Excel® binary (XLS) spreadsheet format.
    SaveDocument
    Exports report content to a stream in the XML-Based Report Archive (PRNX) format.
    See Also