treesheets icon indicating copy to clipboard operation
treesheets copied to clipboard

Ignore folded child grids when exporting to csv

Open jn64 opened this issue 1 year ago • 3 comments

I have some docs that are originally imported from csv, but I added some nested grids. If I want to export them back to csv with the original table structure, I have to manually delete all nested grids first.

Here is a screenshot to illustrate. I would like to be able to export grid 3 without having to manually delete its child grid.

screenshot_2023-06-13_01-07-35


Also, when trying to export grids 2 or 3, I have to enter a filename in the file dialog first, before it gives the error "Cannot export grid that is not flat" in the status bar, which is slightly unintuitive. Sometimes I miss the error and don't realise that no file was exported. It should check whether the operation is possible before showing the file dialog.

jn64 avatar Jun 12 '23 17:06 jn64

There is a Edit -> Grid Reorganization -> Flatten that I added for the purpose of bringing things back to grids, but it doesn't retain the same structure.

I suppose either ignoring folded, or having it just allow it generally (maybe it could give a warning popup instead, saying hierarchical grids were lost)

aardappel avatar Jun 12 '23 17:06 aardappel

For CSV, it would be fine to just automatically ignore child grids. But a benefit of ignoring folded is that it can be extended to other export formats.

One use case is making presentations. You could write things like presentation notes that you don't want to show in the presentation, and fold them. Currently that works for presenting with TreeSheets itself, but not with exporting to HTML (everything is unfolded in the HTML).

jn64 avatar Jun 13 '23 05:06 jn64

What you can do (quite easily at that) is make a lobster script that deletes all subgrids within the selected grid, then perform the csv export, and then perform an undo which will reverse all the changes done with the script.

AntonBogun avatar Jun 18 '23 22:06 AntonBogun