enhancement
major
minor
major
minor
major
#29976
View layer: <tree-table> offers no <export> (Excel export) although the export writes trees as outlines
Observed with 8.0.0-alpha11 in E-Home (haumacher/ehome, doc/tl-todo.md).
Only TableElement.Config declares <export>; TreeTableElement.Config (through AbstractTableElement.Config) has none, and TableExportCommand configured as a command of its own is a configuration error - although TableViewExcelExport writes a tree as an outline of the sheet.
Reproduction: <panel><tree-table root="..." children="..."><export/><columns>...</columns></tree-table></panel> is rejected: unknown property export.
Expected: <export> on <tree-table> like on <table>.
Workaround in E-Home: a subclass of the tree table element contributing TableExportCommand to the panel toolbar, as TableElement#contributeExportCommand does.
Lösung
<tree-table> offers the Excel export <export> with the same options as <table> (download name, sheet name, template, ...). The command appears in the export menu of the toolbar of the enclosing element (e.g. the <panel>).
The tree is written as an outline of the sheet: each node is grouped below its parent at its depth. A tree that cannot be expanded completely (canExpandAll="false") exports only the rows that are currently displayed, so a large or unbounded tree is not computed in full.
All rows of an outline are written visible - also the rows below a collapsed tree node or a collapsed group of a grouped <table>; the reader folds them with the outline buttons of the spreadsheet application. The collapsed state of the table is not transferred: the xlsx format cannot express it reliably for trees. LibreOffice reads the collapsed flag from the row after a group and applies it only to the innermost of several groups ending in the same row, which is the normal case for nested tree nodes - the rows of such a node stayed hidden and could only be revealed with "Show rows".
Technical notes:
- The export property and the contribution of the export command to the enclosing CommandScope move from TableElement to AbstractTableElement, the common base of <table> and <tree-table>. The configuration key of the property's label changes from TableElement.Config.export to AbstractTableElement.Config.export; existing view files need no change.
- TableExportCommand configured as a command of its own is still a configuration error; the message names <table> and <tree-table>.
- TableViewExcelExport writes outline levels only, no hidden rows and no collapsed marks.
- Demo: com.top_logic.demo.react, view "Drag and drop", panel "Tree table".
- <composition-table> is out of scope.