Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work properly when inserting additional rows to named table #34

Open
smahood opened this issue Apr 22, 2016 · 2 comments
Open

Comments

@smahood
Copy link
Contributor

smahood commented Apr 22, 2016

When inserting rows to a named table, upon opening the new file Excel asks to repair the file.
Repair message indicates Repaired Records: Table from /xl/tables/table1.xml part (Table)

The new rows do insert, but do not extend the length of the table to accommodate the new rows.

Reference to tableParts on pages 1698-1699, reference to Tables in general on page 1718, all in ECMA-376, 4th Edition, Office Open XML File Formats — Fundamentals and Markup Language Reference.

@smahood
Copy link
Contributor Author

smahood commented Apr 22, 2016

Looking briefly into a simple file, it looks like we are not properly updating the <table ref> and <autoFilter>attributes in table1.xml

In a manually added and correct file, the section in table1.xml is
`



...

`

In the version produced by excel-templates, that same section is
`



...

`

Both files have had one row added in the middle of the table from the original template.

I haven't found anything else different but it is definitely possible there are other things missing.

@tomfaulhaber
Copy link
Owner

tomfaulhaber commented Apr 22, 2016

This is just not implemented because I didn't think of it/need it.

What we need to do is simply parse and rewrite the range formula in the ref nodes in the context of the correct sheet (just like we do for chart formulas already). Since we're already starting #28, I'm inclined to use the new transformation engine that we'll build for that because I think that doing this with POI will be difficult. If it's a blocker for anyone, let me know and I'll see if I can fix it quickly in the current implementation.

I think that we'll end up having cloning problems with tables as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants