Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Write pivot table row/column axes, filter fields and data fields #2290

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

Merged
merged 9 commits into from
Feb 9, 2024

Conversation

jahav
Copy link
Member

@jahav jahav commented Feb 7, 2024

Improve pivot table Writer2 by adding code to write row/column axes, filter fields, data fields and filters/styles. It now can load and write pivot table with style and not crash (at least sometimes). This is further improvement, so we can just load and write PT without crashing/mangling it.

Pivot table styles use differential formatting, but because ClosedXML doesn't yet have support for it, just use XLStyle object for now, Styles will need a complete rework to support named styles and differential formatting, but that is work for another release in the future.

This is still in Writer2, i.e. unused code paths.

@jahav jahav added this to the v0.104 milestone Feb 7, 2024
jahav added 8 commits February 9, 2024 00:51
Old code has a difficulty reading style because it needs to translate
from file structures to data structures. The new structures are more
in-line with a file, leading to easier loading and saving.

This adds ability to read and write formats, so it can work with
more pivot tables in various files. The code is in Writer2 that is not
used in rest of codebase yet.

We have no special object for dxf, so use XLStyle. That makes me unhappy,
but a lot of things make me unhappy.
The original code

- didn't correctly loaded items because it didn't consider whole row/col
  items.
- writer didn't take into account that non-data item types (e.g. sum)
  always have at least one x item.
Originally, XmlWriter added the namespace declaration at the end of
pivotTableDefinition opening tag, add it at the beginning, so comparison
is easier.
Pivot table is completely under our control and there is no use at this
time of revision or markup compatibility namespace.
@jahav jahav merged commit add389c into develop Feb 9, 2024
@jahav jahav deleted the pivot-rework-4 branch February 9, 2024 00:06
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

Successfully merging this pull request may close these issues.

1 participant