TXLSXTables is the structured-table collection exposed by TXLSXWorksheet.Tables and each TXLSXTable represents one Excel table definition
Declarations
function Add: TXLSXTable; overload;
function Add(const AName, ARange: WideString; AColumns: TStrings): Integer; overload;
function FindByName(const AName: WideString): TXLSXTable;
function DeleteByName(const AName: WideString): Boolean;
property TXLSXTable.Name, DisplayName, Range: WideString;
property TXLSXTable.Columns: TStringList;
property TXLSXTable.StyleName: WideString;
property TXLSXTable.ShowFirstColumn, ShowLastColumn, ShowRowStripes, ShowColumnStripes, TotalsRowShown: Boolean;
function TXLSXTable.FindFirst(ASheet: TXLSXWorksheet; const AColumnName: WideString; const AValue: Variant): Integer;
function TXLSXTable.FindNext(ASheet: TXLSXWorksheet; const AColumnName: WideString; const AValue: Variant; AAfterRow: Integer): Integer;
Table members
| Name and DisplayName | Internal identifier and the table name shown to users |
| Range | Worksheet range in A1 notation |
| Columns | Ordered header names used to write table-column metadata |
| ColumnIds | Stable positive OOXML table-column identifiers |
| ColumnTotalsRowFunctions and ColumnTotalsRowLabels | Per-column totals row configuration |
| ColumnCalculatedColumnFormulas and ColumnTotalsRowFormulas | Per-column structured-table formulas |
| AutoFilterRange, AutoFilterColumns and SortStateXml | Table filter and sort metadata |
| FindFirst and FindNext | Row search by column value on a caller-supplied sheet: FindFirst returns the first 1-based row where the named column equals the value (0 when no match), FindNext continues the scan after AAfterRow; string matches are case-insensitive, numbers compare by value, booleans by truth state, and the table model stays decoupled from any worksheet |
Example
var Columns: TStringList;
begin
Columns := TStringList.Create;
try
Columns.Add('Product');
Columns.Add('Amount');
Sheet.Tables.Add('SalesTable', 'A1:B25', Columns);
Sheet.Tables.FindByName('SalesTable').ShowRowStripes := True;
finally Columns.Free end;
end;See also