mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #283] Outline not collapsed #228
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#228
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @znakeeye on GitHub (Apr 16, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/283
Originally assigned to: @jmcnamara on GitHub.
I'm not able to create collapsed outlines. Is this a bug or am I using the API incorrectly?
Expected:

Actual:

@jmcnamara commented on GitHub (Apr 17, 2020):
I haven't had a chance to look at this but there are lots of examples in the docs, and the repo, where rows are collapsed. https://libxlsxwriter.github.io/working_with_outlines.html
Maybe start with one of those first and reduce it down to what you are trying to do.
@znakeeye commented on GitHub (Apr 17, 2020):
I found the problem. You need to set both
hiddenandcollapsedto true. Not sure why we have two flags when they do nothing on their own (just tried all combinations). Why?@jmcnamara commented on GitHub (Apr 18, 2020):
Yes correct. That's what the doc say:
Rows and columns can be collapsed by setting the hidden member for the hidden rows/columns and setting the collapsed member for the row/column that has the collapsed
'+'symbolThat is what is required by Excel.
@znakeeye commented on GitHub (Apr 20, 2020):
There is one edge case that is not covered by the documentation. Or I'm actually facing a bug.
Note that I'm setting
symbols_belowto false. Then I try setting row options, according to the docs. However, none of the combinations will work for the top row (where the plus sign is). OnlyNULLwill work (or settinglevelto 0). Bug or documentation fix needed?When top row has
NULLoptions it looks correct:@znakeeye commented on GitHub (Apr 20, 2020):
Also, this weirdness only seem to apply the first outline I create (on row 0). After that, a
NULLvalue makes it misbehave. So my code is getting a bit hacky here...@jmcnamara commented on GitHub (May 3, 2020):
I don't understand the issue. Could you open a new GitHub issue with a simple example that should work but doesn't. Please don't use
autoin the example.Also, could you show 2 screenshots from Excel with the uncollapsed and collapsed groups that you are trying to achieve. Make the output match your code example but start it from scratch in Excel.
I'll look into it then.
@znakeeye commented on GitHub (May 4, 2020):
Hm. I might have misunderstood the documentation.
It works, as long as the "expander row" is not part of the outline level (e.g. level=1) and all collapsed rows are marked as hidden (not collapsed). I still don't understand what the use of "collapsed" is.
@evanmiller commented on GitHub (May 6, 2020):
@znakeeye My understanding is that
collapsedapplies only to the expander row. The level=1 rows are "hidden" whereas the level=0 row (above or below) is "collapsed".@znakeeye commented on GitHub (May 6, 2020):
@evanmiller Sure, but when and why would you want to set
lxw_row_col_options.collapsed = LXW_TRUE? My latest attempt showed that this flag was not required. In previous attempts I had to set it for the expander row (and level=1). So I'm quite confused now :P@evanmiller commented on GitHub (May 6, 2020):
@znakeeye Columns can be hidden without being collapsed. So (I think) the collapsed flag indicates whether the rows above/below are hidden due to collapsing or due to regular hiding.
If the flag doesn't look necessary, then it's possible Excel is doing some extra inference.