Worksheet.Set_Column - Grouping Column Issue
See original GitHub issueHi,
I am using XlsxWriter to add grouping to columns dynamically through iterations, but it appears to do incorrectly group columns.
I am using Python version 3.6.3 and XlsxWriter 1.1.5
Here is some code that demonstrates the problem:
import xlsxwriter
for i in range(11, ColEnd):
if ColNum == 6:
ColNum = 1
if ColNum == 1:
secondCol = i +4
SummaryTab.set_column('{}:{}'.format(xlsxwriter.utility.xl_col_to_name(i),
xlsxwriter.utility.xl_col_to_name(secondCol)), 15, None, {'level': 1})
ColNum += 1
SummaryReport.close()
Currently using ‘{}:{}’ to insert the column letter dynamically as it iterates through the numbers, however it does not take the second argument correctly. It will only group the first column rather than the 4 column range.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Outline (group) data in a worksheet - Microsoft Support
Use an outline to group data and quickly display summary rows or columns, or to reveal the detail data for each group.
Read more >How to group columns in Excel - Ablebits
To group columns in Excel, perform these steps: Select the columns you want to group, or at least one cell in each column....
Read more >How to Enable Grouping of Columns in Excel? - eduCBA
To Ungroup Columns in Excel On the Data tab, in the Outline group, click on Ungroup command. Click on the columns and then...
Read more >Can't Add Grouping in Excel? Buttons Greyed-Out? Easy Fix!
The problem · Solution 1: Only select one worksheet to group rows or columns · Solution 2: You are editing a cell –...
Read more >Excel Problem: Group and Ungroup not working in Excel
... how to get the rid of excel problem when Group /Ungroup (Outlin... ... Group /Ungroup (Outline) is not working on a particular...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you submit a small, complete example that demonstrates the issue. A segment of the code isn’t helpful.
Note also,
set_column()
can take a numeric range (for example 0, 2 instead of ‘A:C’). That isn’t related to your issue but it is more efficient. See theset_column()
docs: https://xlsxwriter.readthedocs.io/worksheet.html#worksheet-set-columnGood. Thanks for letting me know. I’ll close the issue.