[英]xlsxwriter - grouping via set_row()
I tried to set some groups in xlsxwriter but it seems I can't get the + Symbol at the top of my group. 我试图在xlsxwriter中设置一些组,但似乎我无法在组的顶部获得+符号。 As it is setting the grouping row-wise I tried to write a function that takes the workbook, the worksheet index and a start/end as well as the level.
因为它正在逐行设置分组,所以我尝试编写一个函数来获取工作簿,工作表索引以及开始/结束以及级别。 But whatever I do the grouping symbol in excel never appears in the first row.
但无论我做什么,excel中的分组符号都不会出现在第一行中。 Funny thing is, if I use something like start_row + 5 for the collapsing row I will get a second + at the right row, but still another one at the end.
有趣的是,如果我使用像start_row + 5这样的东西来折叠行,我将在右侧行获得第二个+ ,但最后还是另一个。 Does anyone know if its possible?
有谁知道它可能吗?
The examples show grouping just for the last row of a group. 这些示例显示的是仅针对组的最后一行进行分组。
def set_group(out_wb, ws_index, start_row, end_row, level):
#added as i used an offset
start_row = start_row
end_row = end_row
out_wb.worksheets()[ws_index].set_row(start_row, None, None, {'level': level, 'collapsed': True})
for i in range(start_row + 1, end_row):
out_wb.worksheets()[ws_index].set_row(i, None, None, {'level': level, 'hidden': True})
return out_wb
您可以使用outline_settings()
工作表方法并将symbols_below
设置为False
:
worksheet.outline_settings(symbols_below=False)
我在版本0.5.5
使用xlsxwriter
,命令行是
worksheet.outline_settings(outline_below=False)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.