TdxCustomReportControl.ExportToText(TStream) Method
Exports report content to a stream in the plain text (TXT) format.
Declaration
procedure ExportToText(AStream: TStream); overload;
Parameters
| Name | Type | Description |
|---|---|---|
| AStream | TStream | The target stream. |
Remarks
Call the ExportToText procedure to export report content to a stream in the plain text format.
Code Example: Export Report Content to TXT File
The following code example exports content of a configured TdxReportControl component to a file in the plain text (TXT) 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.cxButtonExportToTXTClick(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.ExportToText(AStream); // Exports content to a stream in the TXT format
AStream.SaveToFile(dxSaveFileDialog1.FileName); // Saves TXT 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;
Related Compiled Demo
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.
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.
- ExportToXLS
- Exports report content to a stream in the Microsoft Excel® binary (XLS) spreadsheet 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.