XLSX Data Export Demo
The Demo\Delphi\XlsxDataExport project demonstrates how to export
in-memory records to XLSX directly via TXLSXWorkbook, without any
ADO, FireDAC, or dataset component. It is the reference starting point for
in-memory reporting scenarios.
- Define a typed record array and iterate it into worksheet cells.
- Set up workbook-level style pools: bold white header font, blue header fill, alternating light-blue row fill, and a currency number format.
- Add a centered alignment entry to the pool and apply it to the header row via
TXLSXRange.SetAlignmentIndex. - Write revenue as a per-row formula (
Dn*En) so Excel recalculates on open. - Apply
SetAutoFilter, outline and inner borders, and a conditional format that highlights revenue above $900. - Configure print layout:
PrintArea,PrintTitleRows,PrintGridlines, andAddRowBreak. - Set view options:
Zoom := 110andDisplayGridLines := False. - Export the same workbook object to XLSX, CSV, HTML, and RTF without rebuilding it.
Use XlsxDataExport as the baseline for in-memory tabular reporting.
Use ApiTour to learn the full XLS and XLSX API sequence, and use
XlsxFeatureGallery for multi-sheet, chart, RichText, and table coverage.