Exporting the whole treetable

Is there a way to export treetable as if all the nodes are opened without actually opening them on the screen?

Right now I need to save state, openAll, export, set state kind of sequence in order to get the whole tree.

P.S. Would be nice to have exporting functionality for DataCollection, TreeCollection etc.