@@ -16,6 +16,8 @@ def produce_workbook(
16
16
notesheet_label = "Notes" ,
17
17
notesheet_options = {},
18
18
auto_width = True ,
19
+ gridlines = "hide_all" ,
20
+ cover_gridlines = False
19
21
):
20
22
"""
21
23
Produces a GPWorkbook, ready to be written to the specified `.xlsx` file
@@ -50,6 +52,13 @@ def produce_workbook(
50
52
auto_width : bool, optional
51
53
indicate if column widths should be automatically determined. True
52
54
by default.
55
+ gridlines : string, optional
56
+ option to hide or show gridlines on worksheets. "show_all" - don't
57
+ hide gridlines, "hide_printed" - hide printed gridlines only, or
58
+ "hide_all" - hide screen and printed gridlines.
59
+ cover_gridlines : bool, optional
60
+ indication if gridlines should apply to the cover worksheet. False
61
+ by default.
53
62
54
63
Returns
55
64
-------
@@ -64,7 +73,10 @@ def produce_workbook(
64
73
wb .set_theme (theme )
65
74
66
75
if cover is not None :
67
- ws = wb .add_worksheet (cover .cover_label )
76
+ if cover_gridlines :
77
+ ws = wb .add_worksheet (cover .cover_label , gridlines = gridlines )
78
+ else :
79
+ ws = wb .add_worksheet (cover .cover_label , gridlines = "hide_all" )
68
80
ws .write_cover (cover )
69
81
70
82
contentsheet = {}
@@ -90,7 +102,7 @@ def produce_workbook(
90
102
91
103
sheets = {** contentsheet , ** notesheet , ** sheets }
92
104
for label , gptable in sheets .items ():
93
- ws = wb .add_worksheet (label )
105
+ ws = wb .add_worksheet (label , gridlines = gridlines )
94
106
ws .write_gptable (gptable , auto_width , wb ._annotations )
95
107
96
108
return wb
@@ -108,6 +120,8 @@ def write_workbook(
108
120
notesheet_label = "Notes" ,
109
121
notesheet_options = {},
110
122
auto_width = True ,
123
+ gridlines = "hide_all" ,
124
+ cover_gridlines = False
111
125
):
112
126
113
127
"""
@@ -149,6 +163,13 @@ def write_workbook(
149
163
auto_width : bool, optional
150
164
indicate if column widths should be automatically determined. True by
151
165
default.
166
+ gridlines : string, optional
167
+ option to hide or show gridlines on worksheets. "show_all" - don't
168
+ hide gridlines, "hide_printed" - hide printed gridlines only, or
169
+ "hide_all" - hide screen and printed gridlines.
170
+ cover_gridlines : bool, optional
171
+ indication if gridlines should apply to the cover worksheet. False
172
+ by default.
152
173
contentsheet : str
153
174
alias for contentsheet_label, deprecated in v1.1.0
154
175
@@ -169,6 +190,8 @@ def write_workbook(
169
190
notes_table ,
170
191
notesheet_label ,
171
192
notesheet_options ,
172
- auto_width
193
+ auto_width ,
194
+ gridlines ,
195
+ cover_gridlines
173
196
)
174
197
wb .close ()
0 commit comments