Open ralfzosel opened 9 months ago
Thank you for the thorough test case. It does seem that if you accept the refresh and then undo, the resulting data is valid. I can certainly take a look at this though. Might take a few days -- don't know if I will have time this weekend.
@ralfzosel would you mind expanding on your use case for how you want to edit Numbers documents? There are two options for supporting pivot tables in numbers-parser
: leaving pivot tables alone and not trying to rebuild them on save (which is failing) or fully support pivot table creation. The latter would be difficult having taken a quick look at the data structures used. Leaving them untouched would be a quick fix, but I do wonder if references might get broken if rows/columns in source tables are inserted or deleted.
Basically, I am working with a Numbers file that includes one large table containing all the data and many pivot tables for specific views on that data. Whenever I modify data or add data to the table, Numbers itself does not automatically refresh the pivot tables, so I am used to clicking on them all the time to update them. I guess, if numbers-parser would not touch the pivot tables, it should be fine. I can check out whether there are any problems when data is inserted into or deleted from the table.
I've added a test to skip modifying pivot tables which was a small change so quicker than I thought. I've tested on your example and it looks good, but I've not tested on larger examples.
It's published as version 4.8.0.
Actually I tried it on a larger example and it still exhibits the refresh error.
Describe the bug I open a Numbers file that contains a pivot table (
doc = Document("dummy.numbers")
). When I save this file (doc.save("dummy_new.numbers")
) and open it with Numbers, data in the pivot table is missing.To Reproduce
Expected behavior The data in the pivot table should not vanish.
Attachments numbers-files.zip
Additional information
When I try to refresh the pivot table in Numbers, a message pops up: