Overview
TheTTreeExport component provides functionality to export tree diagrams to various formats. It supports text files, XML, HTML tables, Excel spreadsheets, and JSON.
Components
TTreeExportForm
Dialog form for exporting tree data to various formats.CBFullSize- Export using full tree dimensions- Inherits all export options from
TTeeExportFormBase
Export Data Classes
TTreeData (Base Class)
Base class for all tree export formats.TTreeDataText
Export tree structure to delimited text format.- Hierarchical indentation using delimiters
- Configurable delimiter character (tab, comma, etc.)
- Optional text quotes
- Line-by-line node export
TTreeDataXML
Export tree to XML format.- Standard XML structure with node hierarchy
- Compact or formatted output
- Configurable encoding
- Includes node name, class, and text
TTreeDataHTML
Export tree as HTML table.- Hierarchical table structure
- Indentation using empty table cells
- Border styling
- Web-ready output
TTreeDataXLS
Export tree to Excel BIFF format.- Excel 97-2003 compatible format (.xls)
- Hierarchical column layout
- Each level in separate column
- Direct Excel import support
TTreeDataJSON
Export tree to JSON format.- Nested JSON structure
- Standard JSON syntax
- Array-based children
Usage Examples
Show Export Dialog
Modal Export Dialog
Export to Text File
Export to XML
Export to HTML
Export to Excel
Export to JSON
Custom Delimiter Export
Compact XML Export
Helper Functions
ShowTreeExport
Display the tree export dialog.AOwner- Owner component for the dialogATree- Tree to export
Export Formats Summary
| Format | Class | Extension | Use Case |
|---|---|---|---|
| Text | TTreeDataText | .txt, .csv | Simple hierarchical data |
| XML | TTreeDataXML | .xml | Structured data exchange |
| HTML | TTreeDataHTML | .html | Web display |
| Excel | TTreeDataXLS | .xls | Spreadsheet analysis |
| JSON | TTreeDataJSON | .json | Web APIs, JavaScript |
Features
Text Export
- Configurable delimiters (tab, comma, pipe, etc.)
- Optional text quotes
- Hierarchical indentation
- Multi-line node text support
XML Export
- Standard XML 1.0 format
- UTF-8 encoding support
- Compact or formatted output
- Preserves node hierarchy and metadata
HTML Export
- Table-based layout
- Automatic indentation via empty cells
- Browser-ready output
- Customizable via CSS
Excel Export
- BIFF5 format (Excel 97-2003)
- Hierarchical column structure
- Preserves tree levels
- Direct Excel import
JSON Export
- Standard JSON syntax
- Nested object structure
- Array-based children
- JavaScript-ready
Related Components
- TTreeEditor - Visual tree editor
- TCustomTree - Tree component
