write_xlsx 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -1
- data/Changes +3 -0
- data/README.md +1 -1
- data/examples/autofilter.rb +1 -1
- data/examples/chart_area.rb +12 -12
- data/examples/chart_bar.rb +12 -12
- data/examples/chart_clustered.rb +12 -12
- data/examples/chart_column.rb +12 -12
- data/examples/chart_combined.rb +25 -25
- data/examples/chart_data_labels.rb +99 -99
- data/examples/chart_data_table.rb +25 -25
- data/examples/chart_data_tools.rb +50 -50
- data/examples/chart_doughnut.rb +29 -29
- data/examples/chart_gauge.rb +18 -18
- data/examples/chart_line.rb +32 -32
- data/examples/chart_pareto.rb +16 -16
- data/examples/chart_pie.rb +17 -17
- data/examples/chart_radar.rb +38 -38
- data/examples/chart_scatter.rb +12 -12
- data/examples/chart_secondary_axis.rb +13 -13
- data/examples/chart_stock.rb +12 -12
- data/examples/chart_styles.rb +5 -5
- data/examples/colors.rb +11 -11
- data/examples/comments2.rb +15 -15
- data/examples/conditional_format.rb +74 -74
- data/examples/data_validate.rb +64 -64
- data/examples/date_time.rb +3 -3
- data/examples/demo.rb +14 -14
- data/examples/diag_border.rb +6 -6
- data/examples/dynamic_arrays.rb +2 -2
- data/examples/formats.rb +10 -10
- data/examples/hyperlink1.rb +4 -4
- data/examples/ignore_errors.rb +2 -2
- data/examples/indent.rb +2 -2
- data/examples/macros.rb +4 -4
- data/examples/merge1.rb +1 -1
- data/examples/merge2.rb +9 -9
- data/examples/merge3.rb +5 -5
- data/examples/merge4.rb +20 -20
- data/examples/merge5.rb +18 -18
- data/examples/merge6.rb +7 -7
- data/examples/outline.rb +1 -1
- data/examples/outline_collapsed.rb +1 -1
- data/examples/panes.rb +4 -4
- data/examples/properties.rb +9 -9
- data/examples/protection.rb +2 -2
- data/examples/rich_strings.rb +6 -6
- data/examples/shape1.rb +7 -7
- data/examples/shape2.rb +16 -16
- data/examples/shape3.rb +5 -5
- data/examples/shape4.rb +7 -7
- data/examples/shape5.rb +7 -7
- data/examples/shape6.rb +7 -7
- data/examples/shape7.rb +10 -10
- data/examples/shape8.rb +10 -10
- data/examples/shape_all.rb +4 -4
- data/examples/sparklines1.rb +11 -11
- data/examples/sparklines2.rb +76 -76
- data/examples/tables.rb +87 -87
- data/examples/watermark.rb +1 -1
- data/lib/write_xlsx/chart/bar.rb +4 -4
- data/lib/write_xlsx/chart/line.rb +1 -1
- data/lib/write_xlsx/chart/radar.rb +2 -2
- data/lib/write_xlsx/chart/scatter.rb +4 -4
- data/lib/write_xlsx/chart/series.rb +27 -27
- data/lib/write_xlsx/chart/stock.rb +5 -5
- data/lib/write_xlsx/chart.rb +30 -30
- data/lib/write_xlsx/colors.rb +19 -19
- data/lib/write_xlsx/package/conditional_format.rb +3 -3
- data/lib/write_xlsx/package/table.rb +8 -8
- data/lib/write_xlsx/shape.rb +5 -5
- data/lib/write_xlsx/sheets.rb +1 -1
- data/lib/write_xlsx/sparkline.rb +286 -286
- data/lib/write_xlsx/utility.rb +23 -23
- data/lib/write_xlsx/version.rb +1 -1
- data/lib/write_xlsx/workbook.rb +20 -20
- data/lib/write_xlsx/worksheet/cell_data.rb +1 -1
- data/lib/write_xlsx/worksheet.rb +28 -28
- metadata +2 -2
data/examples/shape8.rb
CHANGED
@@ -22,11 +22,11 @@ cx = 210
|
|
22
22
|
cy = 190
|
23
23
|
|
24
24
|
ellipse = workbook.add_shape(
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
25
|
+
type: 'ellipse',
|
26
|
+
id: 2,
|
27
|
+
text: "Hello\nWorld",
|
28
|
+
width: cw,
|
29
|
+
height: ch
|
30
30
|
)
|
31
31
|
worksheet.insert_shape('A1', ellipse, cx, cy)
|
32
32
|
|
@@ -37,10 +37,10 @@ px = 120
|
|
37
37
|
py = 250
|
38
38
|
|
39
39
|
plus = workbook.add_shape(
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
40
|
+
type: 'plus',
|
41
|
+
id: 3,
|
42
|
+
width: pw,
|
43
|
+
height: ph
|
44
44
|
)
|
45
45
|
|
46
46
|
p1 = worksheet.insert_shape('A1', plus, 350, 150)
|
@@ -48,7 +48,7 @@ p2 = worksheet.insert_shape('A1', plus, 350, 350)
|
|
48
48
|
p3 = worksheet.insert_shape('A1', plus, 150, 350)
|
49
49
|
p4 = worksheet.insert_shape('A1', plus, 150, 150)
|
50
50
|
|
51
|
-
cxn_shape = workbook.add_shape(:
|
51
|
+
cxn_shape = workbook.add_shape(type: 'bentConnector3', fill: 0)
|
52
52
|
|
53
53
|
cxn_shape.start = ellipse.id
|
54
54
|
cxn_shape.start_index = 2 # 2nd connection pt, clockwise from top(0).
|
data/examples/shape_all.rb
CHANGED
@@ -225,10 +225,10 @@ shapes_list.each_line do |line|
|
|
225
225
|
end
|
226
226
|
last_sheet = sheet
|
227
227
|
shape = workbook.add_shape(
|
228
|
-
:
|
229
|
-
:
|
230
|
-
:
|
231
|
-
:
|
228
|
+
type: name,
|
229
|
+
text: name,
|
230
|
+
width: 90,
|
231
|
+
height: 90
|
232
232
|
)
|
233
233
|
|
234
234
|
# Connectors can not have labels, so write the connector name in the cell
|
data/examples/sparklines1.rb
CHANGED
@@ -31,29 +31,29 @@ worksheet.write_col('A1', data)
|
|
31
31
|
# Add a line sparkline (the default) with markers.
|
32
32
|
worksheet.add_sparkline(
|
33
33
|
{
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
34
|
+
location: 'F1',
|
35
|
+
range: 'Sheet1!A1:E1',
|
36
|
+
markers: 1
|
37
37
|
}
|
38
38
|
)
|
39
39
|
|
40
40
|
# Add a column sparkline with non-default style.
|
41
41
|
worksheet.add_sparkline(
|
42
42
|
{
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
43
|
+
location: 'F2',
|
44
|
+
range: 'Sheet1!A2:E2',
|
45
|
+
type: 'column',
|
46
|
+
style: 12
|
47
47
|
}
|
48
48
|
)
|
49
49
|
|
50
50
|
# Add a win/loss sparkline with negative values highlighted.
|
51
51
|
worksheet.add_sparkline(
|
52
52
|
{
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
53
|
+
location: 'F3',
|
54
|
+
range: 'Sheet1!A3:E3',
|
55
|
+
type: 'win_loss',
|
56
|
+
negative_points: 1
|
57
57
|
}
|
58
58
|
)
|
59
59
|
|
data/examples/sparklines2.rb
CHANGED
@@ -18,7 +18,7 @@ require 'write_xlsx'
|
|
18
18
|
workbook = WriteXLSX.new('sparklines2.xlsx')
|
19
19
|
worksheet1 = workbook.add_worksheet
|
20
20
|
worksheet2 = workbook.add_worksheet
|
21
|
-
bold = workbook.add_format(:
|
21
|
+
bold = workbook.add_format(bold: 1)
|
22
22
|
row = 1
|
23
23
|
|
24
24
|
# Set the columns widths to make the output clearer.
|
@@ -36,8 +36,8 @@ str = 'A default "line" sparkline.'
|
|
36
36
|
|
37
37
|
worksheet1.add_sparkline(
|
38
38
|
{
|
39
|
-
:
|
40
|
-
:
|
39
|
+
location: 'A2',
|
40
|
+
range: 'Sheet2!A1:J1'
|
41
41
|
}
|
42
42
|
)
|
43
43
|
|
@@ -50,9 +50,9 @@ str = 'A default "column" sparkline.'
|
|
50
50
|
|
51
51
|
worksheet1.add_sparkline(
|
52
52
|
{
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
53
|
+
location: 'A3',
|
54
|
+
range: 'Sheet2!A2:J2',
|
55
|
+
type: 'column'
|
56
56
|
}
|
57
57
|
)
|
58
58
|
|
@@ -65,9 +65,9 @@ str = 'A default "win/loss" sparkline.'
|
|
65
65
|
|
66
66
|
worksheet1.add_sparkline(
|
67
67
|
{
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
68
|
+
location: 'A4',
|
69
|
+
range: 'Sheet2!A3:J3',
|
70
|
+
type: 'win_loss'
|
71
71
|
}
|
72
72
|
)
|
73
73
|
|
@@ -80,9 +80,9 @@ str = 'Line with markers.'
|
|
80
80
|
|
81
81
|
worksheet1.add_sparkline(
|
82
82
|
{
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
83
|
+
location: 'A6',
|
84
|
+
range: 'Sheet2!A1:J1',
|
85
|
+
markers: 1
|
86
86
|
}
|
87
87
|
)
|
88
88
|
|
@@ -95,10 +95,10 @@ str = 'Line with high and low points.'
|
|
95
95
|
|
96
96
|
worksheet1.add_sparkline(
|
97
97
|
{
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
98
|
+
location: 'A7',
|
99
|
+
range: 'Sheet2!A1:J1',
|
100
|
+
high_point: 1,
|
101
|
+
low_point: 1
|
102
102
|
}
|
103
103
|
)
|
104
104
|
|
@@ -111,10 +111,10 @@ str = 'Line with first and last point markers.'
|
|
111
111
|
|
112
112
|
worksheet1.add_sparkline(
|
113
113
|
{
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
114
|
+
location: 'A8',
|
115
|
+
range: 'Sheet2!A1:J1',
|
116
|
+
first_point: 1,
|
117
|
+
last_point: 1
|
118
118
|
}
|
119
119
|
)
|
120
120
|
|
@@ -127,9 +127,9 @@ str = 'Line with negative point markers.'
|
|
127
127
|
|
128
128
|
worksheet1.add_sparkline(
|
129
129
|
{
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
130
|
+
location: 'A9',
|
131
|
+
range: 'Sheet2!A1:J1',
|
132
|
+
negative_points: 1
|
133
133
|
}
|
134
134
|
)
|
135
135
|
|
@@ -142,9 +142,9 @@ str = 'Line with axis.'
|
|
142
142
|
|
143
143
|
worksheet1.add_sparkline(
|
144
144
|
{
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
145
|
+
location: 'A10',
|
146
|
+
range: 'Sheet2!A1:J1',
|
147
|
+
axis: 1
|
148
148
|
}
|
149
149
|
)
|
150
150
|
|
@@ -157,9 +157,9 @@ str = 'Column with default style (1).'
|
|
157
157
|
|
158
158
|
worksheet1.add_sparkline(
|
159
159
|
{
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
160
|
+
location: 'A12',
|
161
|
+
range: 'Sheet2!A2:J2',
|
162
|
+
type: 'column'
|
163
163
|
}
|
164
164
|
)
|
165
165
|
|
@@ -172,10 +172,10 @@ str = 'Column with style 2.'
|
|
172
172
|
|
173
173
|
worksheet1.add_sparkline(
|
174
174
|
{
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
175
|
+
location: 'A13',
|
176
|
+
range: 'Sheet2!A2:J2',
|
177
|
+
type: 'column',
|
178
|
+
style: 2
|
179
179
|
}
|
180
180
|
)
|
181
181
|
|
@@ -188,10 +188,10 @@ str = 'Column with style 3.'
|
|
188
188
|
|
189
189
|
worksheet1.add_sparkline(
|
190
190
|
{
|
191
|
-
:
|
192
|
-
:
|
193
|
-
:
|
194
|
-
:
|
191
|
+
location: 'A14',
|
192
|
+
range: 'Sheet2!A2:J2',
|
193
|
+
type: 'column',
|
194
|
+
style: 3
|
195
195
|
}
|
196
196
|
)
|
197
197
|
|
@@ -204,10 +204,10 @@ str = 'Column with style 4.'
|
|
204
204
|
|
205
205
|
worksheet1.add_sparkline(
|
206
206
|
{
|
207
|
-
:
|
208
|
-
:
|
209
|
-
:
|
210
|
-
:
|
207
|
+
location: 'A15',
|
208
|
+
range: 'Sheet2!A2:J2',
|
209
|
+
type: 'column',
|
210
|
+
style: 4
|
211
211
|
}
|
212
212
|
)
|
213
213
|
|
@@ -220,10 +220,10 @@ str = 'Column with style 5.'
|
|
220
220
|
|
221
221
|
worksheet1.add_sparkline(
|
222
222
|
{
|
223
|
-
:
|
224
|
-
:
|
225
|
-
:
|
226
|
-
:
|
223
|
+
location: 'A16',
|
224
|
+
range: 'Sheet2!A2:J2',
|
225
|
+
type: 'column',
|
226
|
+
style: 5
|
227
227
|
}
|
228
228
|
)
|
229
229
|
|
@@ -236,10 +236,10 @@ str = 'Column with style 6.'
|
|
236
236
|
|
237
237
|
worksheet1.add_sparkline(
|
238
238
|
{
|
239
|
-
:
|
240
|
-
:
|
241
|
-
:
|
242
|
-
:
|
239
|
+
location: 'A17',
|
240
|
+
range: 'Sheet2!A2:J2',
|
241
|
+
type: 'column',
|
242
|
+
style: 6
|
243
243
|
}
|
244
244
|
)
|
245
245
|
|
@@ -252,10 +252,10 @@ str = 'Column with a user defined colour.'
|
|
252
252
|
|
253
253
|
worksheet1.add_sparkline(
|
254
254
|
{
|
255
|
-
:
|
256
|
-
:
|
257
|
-
:
|
258
|
-
:
|
255
|
+
location: 'A18',
|
256
|
+
range: 'Sheet2!A2:J2',
|
257
|
+
type: 'column',
|
258
|
+
series_color: '#E965E0'
|
259
259
|
}
|
260
260
|
)
|
261
261
|
|
@@ -268,9 +268,9 @@ str = 'A win/loss sparkline.'
|
|
268
268
|
|
269
269
|
worksheet1.add_sparkline(
|
270
270
|
{
|
271
|
-
:
|
272
|
-
:
|
273
|
-
:
|
271
|
+
location: 'A20',
|
272
|
+
range: 'Sheet2!A3:J3',
|
273
|
+
type: 'win_loss'
|
274
274
|
}
|
275
275
|
)
|
276
276
|
|
@@ -283,10 +283,10 @@ str = 'A win/loss sparkline with negative points highlighted.'
|
|
283
283
|
|
284
284
|
worksheet1.add_sparkline(
|
285
285
|
{
|
286
|
-
:
|
287
|
-
:
|
288
|
-
:
|
289
|
-
:
|
286
|
+
location: 'A21',
|
287
|
+
range: 'Sheet2!A3:J3',
|
288
|
+
type: 'win_loss',
|
289
|
+
negative_points: 1
|
290
290
|
}
|
291
291
|
)
|
292
292
|
|
@@ -299,10 +299,10 @@ str = 'A left to right column (the default).'
|
|
299
299
|
|
300
300
|
worksheet1.add_sparkline(
|
301
301
|
{
|
302
|
-
:
|
303
|
-
:
|
304
|
-
:
|
305
|
-
:
|
302
|
+
location: 'A23',
|
303
|
+
range: 'Sheet2!A4:J4',
|
304
|
+
type: 'column',
|
305
|
+
style: 20
|
306
306
|
}
|
307
307
|
)
|
308
308
|
|
@@ -315,11 +315,11 @@ str = 'A right to left column.'
|
|
315
315
|
|
316
316
|
worksheet1.add_sparkline(
|
317
317
|
{
|
318
|
-
:
|
319
|
-
:
|
320
|
-
:
|
321
|
-
:
|
322
|
-
:
|
318
|
+
location: 'A24',
|
319
|
+
range: 'Sheet2!A4:J4',
|
320
|
+
type: 'column',
|
321
|
+
style: 20,
|
322
|
+
reverse: 1
|
323
323
|
}
|
324
324
|
)
|
325
325
|
|
@@ -332,10 +332,10 @@ str = 'Sparkline and text in one cell.'
|
|
332
332
|
|
333
333
|
worksheet1.add_sparkline(
|
334
334
|
{
|
335
|
-
:
|
336
|
-
:
|
337
|
-
:
|
338
|
-
:
|
335
|
+
location: 'A25',
|
336
|
+
range: 'Sheet2!A4:J4',
|
337
|
+
type: 'column',
|
338
|
+
style: 20
|
339
339
|
}
|
340
340
|
)
|
341
341
|
|
@@ -349,9 +349,9 @@ str = 'A grouped sparkline. Changes are applied to all three.'
|
|
349
349
|
|
350
350
|
worksheet1.add_sparkline(
|
351
351
|
{
|
352
|
-
:
|
353
|
-
:
|
354
|
-
:
|
352
|
+
location: %w[A27 A28 A29],
|
353
|
+
range: ['Sheet2!A5:J5', 'Sheet2!A6:J6', 'Sheet2!A7:J7'],
|
354
|
+
markers: 1
|
355
355
|
}
|
356
356
|
)
|
357
357
|
|
data/examples/tables.rb
CHANGED
@@ -30,7 +30,7 @@ worksheet11 = workbook.add_worksheet
|
|
30
30
|
worksheet12 = workbook.add_worksheet
|
31
31
|
worksheet13 = workbook.add_worksheet
|
32
32
|
|
33
|
-
currency_format = workbook.add_format(:
|
33
|
+
currency_format = workbook.add_format(num_format: '$#,##0')
|
34
34
|
|
35
35
|
# Some sample data for the table.
|
36
36
|
data = [
|
@@ -68,7 +68,7 @@ worksheet2.set_column('B:G', 12)
|
|
68
68
|
worksheet2.write('B1', caption)
|
69
69
|
|
70
70
|
# Add a table to the worksheet.
|
71
|
-
worksheet2.add_table('B3:F7', { :
|
71
|
+
worksheet2.add_table('B3:F7', { data: data })
|
72
72
|
|
73
73
|
###############################################################################
|
74
74
|
#
|
@@ -83,7 +83,7 @@ worksheet3.set_column('B:G', 12)
|
|
83
83
|
worksheet3.write('B1', caption)
|
84
84
|
|
85
85
|
# Add a table to the worksheet.
|
86
|
-
worksheet3.add_table('B3:F7', { :
|
86
|
+
worksheet3.add_table('B3:F7', { autofilter: 0 })
|
87
87
|
|
88
88
|
# Table data can also be written separately, as an array or individual cells.
|
89
89
|
worksheet3.write_col('B4', data)
|
@@ -101,7 +101,7 @@ worksheet4.set_column('B:G', 12)
|
|
101
101
|
worksheet4.write('B1', caption)
|
102
102
|
|
103
103
|
# Add a table to the worksheet.
|
104
|
-
worksheet4.add_table('B4:F7', { :
|
104
|
+
worksheet4.add_table('B4:F7', { header_row: 0 })
|
105
105
|
|
106
106
|
# Table data can also be written separately, as an array or individual cells.
|
107
107
|
worksheet4.write_col('B4', data)
|
@@ -119,7 +119,7 @@ worksheet5.set_column('B:G', 12)
|
|
119
119
|
worksheet5.write('B1', caption)
|
120
120
|
|
121
121
|
# Add a table to the worksheet.
|
122
|
-
worksheet5.add_table('B3:F7', { :
|
122
|
+
worksheet5.add_table('B3:F7', { first_column: 1, last_column: 1 })
|
123
123
|
|
124
124
|
# Table data can also be written separately, as an array or individual cells.
|
125
125
|
worksheet5.write_col('B4', data)
|
@@ -137,7 +137,7 @@ worksheet6.set_column('B:G', 12)
|
|
137
137
|
worksheet6.write('B1', caption)
|
138
138
|
|
139
139
|
# Add a table to the worksheet.
|
140
|
-
worksheet6.add_table('B3:F7', { :
|
140
|
+
worksheet6.add_table('B3:F7', { banded_rows: 0, banded_columns: 1 })
|
141
141
|
|
142
142
|
# Table data can also be written separately, as an array or individual cells.
|
143
143
|
worksheet6.write_col('B4', data)
|
@@ -158,13 +158,13 @@ worksheet7.write('B1', caption)
|
|
158
158
|
worksheet7.add_table(
|
159
159
|
'B3:F7',
|
160
160
|
{
|
161
|
-
:
|
162
|
-
:
|
163
|
-
{ :
|
164
|
-
{ :
|
165
|
-
{ :
|
166
|
-
{ :
|
167
|
-
{ :
|
161
|
+
data: data,
|
162
|
+
columns: [
|
163
|
+
{ header: 'Product' },
|
164
|
+
{ header: 'Quarter 1' },
|
165
|
+
{ header: 'Quarter 2' },
|
166
|
+
{ header: 'Quarter 3' },
|
167
|
+
{ header: 'Quarter 4' }
|
168
168
|
]
|
169
169
|
}
|
170
170
|
)
|
@@ -185,16 +185,16 @@ worksheet8.write('B1', caption)
|
|
185
185
|
worksheet8.add_table(
|
186
186
|
'B3:G7',
|
187
187
|
{
|
188
|
-
:
|
189
|
-
:
|
190
|
-
{ :
|
191
|
-
{ :
|
192
|
-
{ :
|
193
|
-
{ :
|
194
|
-
{ :
|
188
|
+
data: data,
|
189
|
+
columns: [
|
190
|
+
{ header: 'Product' },
|
191
|
+
{ header: 'Quarter 1' },
|
192
|
+
{ header: 'Quarter 2' },
|
193
|
+
{ header: 'Quarter 3' },
|
194
|
+
{ header: 'Quarter 4' },
|
195
195
|
{
|
196
|
-
:
|
197
|
-
:
|
196
|
+
header: 'Year',
|
197
|
+
formula: '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
|
198
198
|
}
|
199
199
|
]
|
200
200
|
}
|
@@ -216,17 +216,17 @@ worksheet9.write('B1', caption)
|
|
216
216
|
worksheet9.add_table(
|
217
217
|
'B3:G8',
|
218
218
|
{
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
{ :
|
223
|
-
{ :
|
224
|
-
{ :
|
225
|
-
{ :
|
226
|
-
{ :
|
219
|
+
data: data,
|
220
|
+
total_row: 1,
|
221
|
+
columns: [
|
222
|
+
{ header: 'Product' },
|
223
|
+
{ header: 'Quarter 1' },
|
224
|
+
{ header: 'Quarter 2' },
|
225
|
+
{ header: 'Quarter 3' },
|
226
|
+
{ header: 'Quarter 4' },
|
227
227
|
{
|
228
|
-
:
|
229
|
-
:
|
228
|
+
header: 'Year',
|
229
|
+
formula: '=SUM(Table8[@[Quarter 1]:[Quarter 4]])'
|
230
230
|
}
|
231
231
|
]
|
232
232
|
}
|
@@ -248,18 +248,18 @@ worksheet10.write('B1', caption)
|
|
248
248
|
worksheet10.add_table(
|
249
249
|
'B3:G8',
|
250
250
|
{
|
251
|
-
:
|
252
|
-
:
|
253
|
-
:
|
254
|
-
{ :
|
255
|
-
{ :
|
256
|
-
{ :
|
257
|
-
{ :
|
258
|
-
{ :
|
251
|
+
data: data,
|
252
|
+
total_row: 1,
|
253
|
+
columns: [
|
254
|
+
{ header: 'Product', total_string: 'Totals' },
|
255
|
+
{ header: 'Quarter 1', total_function: 'sum' },
|
256
|
+
{ header: 'Quarter 2', total_function: 'sum' },
|
257
|
+
{ header: 'Quarter 3', total_function: 'sum' },
|
258
|
+
{ header: 'Quarter 4', total_function: 'sum' },
|
259
259
|
{
|
260
|
-
:
|
261
|
-
:
|
262
|
-
:
|
260
|
+
header: 'Year',
|
261
|
+
formula: '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
|
262
|
+
total_function: 'sum'
|
263
263
|
}
|
264
264
|
]
|
265
265
|
}
|
@@ -281,19 +281,19 @@ worksheet11.write('B1', caption)
|
|
281
281
|
worksheet11.add_table(
|
282
282
|
'B3:G8',
|
283
283
|
{
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
288
|
-
{ :
|
289
|
-
{ :
|
290
|
-
{ :
|
291
|
-
{ :
|
292
|
-
{ :
|
284
|
+
data: data,
|
285
|
+
style: 'Table Style Light 11',
|
286
|
+
total_row: 1,
|
287
|
+
columns: [
|
288
|
+
{ header: 'Product', total_string: 'Totals' },
|
289
|
+
{ header: 'Quarter 1', total_function: 'sum' },
|
290
|
+
{ header: 'Quarter 2', total_function: 'sum' },
|
291
|
+
{ header: 'Quarter 3', total_function: 'sum' },
|
292
|
+
{ header: 'Quarter 4', total_function: 'sum' },
|
293
293
|
{
|
294
|
-
:
|
295
|
-
:
|
296
|
-
:
|
294
|
+
header: 'Year',
|
295
|
+
formula: '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
|
296
|
+
total_function: 'sum'
|
297
297
|
}
|
298
298
|
]
|
299
299
|
}
|
@@ -315,19 +315,19 @@ worksheet12.write('B1', caption)
|
|
315
315
|
worksheet12.add_table(
|
316
316
|
'B3:G8',
|
317
317
|
{
|
318
|
-
:
|
319
|
-
:
|
320
|
-
:
|
321
|
-
:
|
322
|
-
{ :
|
323
|
-
{ :
|
324
|
-
{ :
|
325
|
-
{ :
|
326
|
-
{ :
|
318
|
+
data: data,
|
319
|
+
style: 'None',
|
320
|
+
total_row: 1,
|
321
|
+
columns: [
|
322
|
+
{ header: 'Product', total_string: 'Totals' },
|
323
|
+
{ header: 'Quarter 1', total_function: 'sum' },
|
324
|
+
{ header: 'Quarter 2', total_function: 'sum' },
|
325
|
+
{ header: 'Quarter 3', total_function: 'sum' },
|
326
|
+
{ header: 'Quarter 4', total_function: 'sum' },
|
327
327
|
{
|
328
|
-
:
|
329
|
-
:
|
330
|
-
:
|
328
|
+
header: 'Year',
|
329
|
+
formula: '=SUM(Table12[@[Quarter 1]:[Quarter 4]])',
|
330
|
+
total_function: 'sum'
|
331
331
|
}
|
332
332
|
]
|
333
333
|
}
|
@@ -349,35 +349,35 @@ worksheet13.write('B1', caption)
|
|
349
349
|
worksheet13.add_table(
|
350
350
|
'B3:G8',
|
351
351
|
{
|
352
|
-
:
|
353
|
-
:
|
354
|
-
:
|
355
|
-
{ :
|
352
|
+
data: data,
|
353
|
+
total_row: 1,
|
354
|
+
columns: [
|
355
|
+
{ header: 'Product', total_string: 'Totals' },
|
356
356
|
{
|
357
|
-
:
|
358
|
-
:
|
359
|
-
:
|
357
|
+
header: 'Quarter 1',
|
358
|
+
total_function: 'sum',
|
359
|
+
format: currency_format
|
360
360
|
},
|
361
361
|
{
|
362
|
-
:
|
363
|
-
:
|
364
|
-
:
|
362
|
+
header: 'Quarter 2',
|
363
|
+
total_function: 'sum',
|
364
|
+
format: currency_format
|
365
365
|
},
|
366
366
|
{
|
367
|
-
:
|
368
|
-
:
|
369
|
-
:
|
367
|
+
header: 'Quarter 3',
|
368
|
+
total_function: 'sum',
|
369
|
+
format: currency_format
|
370
370
|
},
|
371
371
|
{
|
372
|
-
:
|
373
|
-
:
|
374
|
-
:
|
372
|
+
header: 'Quarter 4',
|
373
|
+
total_function: 'sum',
|
374
|
+
format: currency_format
|
375
375
|
},
|
376
376
|
{
|
377
|
-
:
|
378
|
-
:
|
379
|
-
:
|
380
|
-
:
|
377
|
+
header: 'Year',
|
378
|
+
formula: '=SUM(Table8[@[Quarter 1]:[Quarter 4]])',
|
379
|
+
total_function: 'sum',
|
380
|
+
format: currency_format
|
381
381
|
}
|
382
382
|
]
|
383
383
|
}
|