element.
|
120
|
|
|
|
|
|
|
# |
|
121
|
|
|
|
|
|
|
sub _write_table { |
|
122
|
|
|
|
|
|
|
|
|
123
|
47
|
|
|
47
|
|
105
|
my $self = shift; |
|
124
|
47
|
|
|
|
|
243
|
my $schema = 'http://schemas.openxmlformats.org/'; |
|
125
|
47
|
|
|
|
|
180
|
my $xmlns = $schema . 'spreadsheetml/2006/main'; |
|
126
|
47
|
|
|
|
|
143
|
my $id = $self->{_properties}->{_id}; |
|
127
|
47
|
|
|
|
|
260
|
my $name = $self->{_properties}->{_name}; |
|
128
|
47
|
|
|
|
|
115
|
my $display_name = $self->{_properties}->{_name}; |
|
129
|
47
|
|
|
|
|
130
|
my $ref = $self->{_properties}->{_range}; |
|
130
|
47
|
|
|
|
|
117
|
my $totals_row_shown = $self->{_properties}->{_totals_row_shown}; |
|
131
|
47
|
|
|
|
|
222
|
my $header_row_count = $self->{_properties}->{_header_row_count}; |
|
132
|
|
|
|
|
|
|
|
|
133
|
47
|
|
|
|
|
251
|
my @attributes = ( |
|
134
|
|
|
|
|
|
|
'xmlns' => $xmlns, |
|
135
|
|
|
|
|
|
|
'id' => $id, |
|
136
|
|
|
|
|
|
|
'name' => $name, |
|
137
|
|
|
|
|
|
|
'displayName' => $display_name, |
|
138
|
|
|
|
|
|
|
'ref' => $ref, |
|
139
|
|
|
|
|
|
|
); |
|
140
|
|
|
|
|
|
|
|
|
141
|
47
|
100
|
|
|
|
215
|
push @attributes, ( 'headerRowCount' => 0 ) if !$header_row_count; |
|
142
|
|
|
|
|
|
|
|
|
143
|
47
|
100
|
|
|
|
166
|
if ( $totals_row_shown ) { |
|
144
|
10
|
|
|
|
|
43
|
push @attributes, ( 'totalsRowCount' => 1 ); |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
else { |
|
147
|
37
|
|
|
|
|
123
|
push @attributes, ( 'totalsRowShown' => 0 ); |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
|
151
|
47
|
|
|
|
|
347
|
$self->xml_start_tag( 'table', @attributes ); |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
############################################################################## |
|
156
|
|
|
|
|
|
|
# |
|
157
|
|
|
|
|
|
|
# _write_auto_filter() |
|
158
|
|
|
|
|
|
|
# |
|
159
|
|
|
|
|
|
|
# Write the element. |
|
160
|
|
|
|
|
|
|
# |
|
161
|
|
|
|
|
|
|
sub _write_auto_filter { |
|
162
|
|
|
|
|
|
|
|
|
163
|
48
|
|
|
48
|
|
136
|
my $self = shift; |
|
164
|
48
|
|
|
|
|
128
|
my $autofilter = $self->{_properties}->{_autofilter}; |
|
165
|
|
|
|
|
|
|
|
|
166
|
48
|
100
|
|
|
|
224
|
return unless $autofilter; |
|
167
|
|
|
|
|
|
|
|
|
168
|
44
|
|
|
|
|
148
|
my @attributes = ( 'ref' => $autofilter, ); |
|
169
|
|
|
|
|
|
|
|
|
170
|
44
|
|
|
|
|
260
|
$self->xml_empty_tag( 'autoFilter', @attributes ); |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
############################################################################## |
|
175
|
|
|
|
|
|
|
# |
|
176
|
|
|
|
|
|
|
# _write_table_columns() |
|
177
|
|
|
|
|
|
|
# |
|
178
|
|
|
|
|
|
|
# Write the element. |
|
179
|
|
|
|
|
|
|
# |
|
180
|
|
|
|
|
|
|
sub _write_table_columns { |
|
181
|
|
|
|
|
|
|
|
|
182
|
47
|
|
|
47
|
|
108
|
my $self = shift; |
|
183
|
47
|
|
|
|
|
115
|
my @columns = @{ $self->{_properties}->{_columns} }; |
|
|
47
|
|
|
|
|
173
|
|
|
184
|
|
|
|
|
|
|
|
|
185
|
47
|
|
|
|
|
224
|
my $count = scalar @columns; |
|
186
|
|
|
|
|
|
|
|
|
187
|
47
|
|
|
|
|
150
|
my @attributes = ( 'count' => $count, ); |
|
188
|
|
|
|
|
|
|
|
|
189
|
47
|
|
|
|
|
279
|
$self->xml_start_tag( 'tableColumns', @attributes ); |
|
190
|
|
|
|
|
|
|
|
|
191
|
47
|
|
|
|
|
265
|
for my $col_data ( @columns ) { |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# Write the tableColumn element. |
|
194
|
210
|
|
|
|
|
731
|
$self->_write_table_column( $col_data ); |
|
195
|
|
|
|
|
|
|
} |
|
196
|
|
|
|
|
|
|
|
|
197
|
47
|
|
|
|
|
297
|
$self->xml_end_tag( 'tableColumns' ); |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
############################################################################## |
|
202
|
|
|
|
|
|
|
# |
|
203
|
|
|
|
|
|
|
# _write_table_column() |
|
204
|
|
|
|
|
|
|
# |
|
205
|
|
|
|
|
|
|
# Write the element. |
|
206
|
|
|
|
|
|
|
# |
|
207
|
|
|
|
|
|
|
sub _write_table_column { |
|
208
|
|
|
|
|
|
|
|
|
209
|
211
|
|
|
211
|
|
521
|
my $self = shift; |
|
210
|
211
|
|
|
|
|
496
|
my $col_data = shift; |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
my @attributes = ( |
|
213
|
|
|
|
|
|
|
'id' => $col_data->{_id}, |
|
214
|
|
|
|
|
|
|
'name' => $col_data->{_name}, |
|
215
|
211
|
|
|
|
|
716
|
); |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
|
218
|
211
|
100
|
|
|
|
786
|
if ( $col_data->{_total_string} ) { |
|
|
|
100
|
|
|
|
|
|
|
219
|
9
|
|
|
|
|
42
|
push @attributes, ( totalsRowLabel => $col_data->{_total_string} ); |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
elsif ( $col_data->{_total_function} ) { |
|
222
|
40
|
|
|
|
|
79
|
push @attributes, ( totalsRowFunction => $col_data->{_total_function} ); |
|
223
|
|
|
|
|
|
|
} |
|
224
|
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
|
|
226
|
211
|
100
|
|
|
|
480
|
if ( defined $col_data->{_format} ) { |
|
227
|
9
|
|
|
|
|
24
|
push @attributes, ( dataDxfId => $col_data->{_format} ); |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
|
|
230
|
211
|
100
|
|
|
|
491
|
if ( $col_data->{_formula} ) { |
|
231
|
3
|
|
|
|
|
11
|
$self->xml_start_tag( 'tableColumn', @attributes ); |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
# Write the calculatedColumnFormula element. |
|
234
|
3
|
|
|
|
|
21
|
$self->_write_calculated_column_formula( $col_data->{_formula} ); |
|
235
|
|
|
|
|
|
|
|
|
236
|
3
|
|
|
|
|
30
|
$self->xml_end_tag( 'tableColumn' ); |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
else { |
|
239
|
208
|
|
|
|
|
570
|
$self->xml_empty_tag( 'tableColumn', @attributes ); |
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
} |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
############################################################################## |
|
246
|
|
|
|
|
|
|
# |
|
247
|
|
|
|
|
|
|
# _write_table_style_info() |
|
248
|
|
|
|
|
|
|
# |
|
249
|
|
|
|
|
|
|
# Write the element. |
|
250
|
|
|
|
|
|
|
# |
|
251
|
|
|
|
|
|
|
sub _write_table_style_info { |
|
252
|
|
|
|
|
|
|
|
|
253
|
48
|
|
|
48
|
|
144
|
my $self = shift; |
|
254
|
48
|
|
|
|
|
129
|
my $props = $self->{_properties}; |
|
255
|
|
|
|
|
|
|
|
|
256
|
48
|
|
|
|
|
112
|
my @attributes = (); |
|
257
|
48
|
|
|
|
|
144
|
my $name = $props->{_style}; |
|
258
|
48
|
|
|
|
|
122
|
my $show_first_column = $props->{_show_first_col}; |
|
259
|
48
|
|
|
|
|
119
|
my $show_last_column = $props->{_show_last_col}; |
|
260
|
48
|
|
|
|
|
110
|
my $show_row_stripes = $props->{_show_row_stripes}; |
|
261
|
48
|
|
|
|
|
106
|
my $show_column_stripes = $props->{_show_col_stripes}; |
|
262
|
|
|
|
|
|
|
|
|
263
|
48
|
100
|
33
|
|
|
479
|
if ( $name && $name ne '' && $name ne 'None' ) { |
|
|
|
|
66
|
|
|
|
|
|
264
|
47
|
|
|
|
|
147
|
push @attributes, ( 'name' => $name ); |
|
265
|
|
|
|
|
|
|
} |
|
266
|
|
|
|
|
|
|
|
|
267
|
48
|
|
|
|
|
147
|
push @attributes, ( 'showFirstColumn' => $show_first_column ); |
|
268
|
48
|
|
|
|
|
322
|
push @attributes, ( 'showLastColumn' => $show_last_column ); |
|
269
|
48
|
|
|
|
|
306
|
push @attributes, ( 'showRowStripes' => $show_row_stripes ); |
|
270
|
48
|
|
|
|
|
145
|
push @attributes, ( 'showColumnStripes' => $show_column_stripes ); |
|
271
|
|
|
|
|
|
|
|
|
272
|
48
|
|
|
|
|
218
|
$self->xml_empty_tag( 'tableStyleInfo', @attributes ); |
|
273
|
|
|
|
|
|
|
} |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
############################################################################## |
|
277
|
|
|
|
|
|
|
# |
|
278
|
|
|
|
|
|
|
# _write_calculated_column_formula() |
|
279
|
|
|
|
|
|
|
# |
|
280
|
|
|
|
|
|
|
# Write the element. |
|
281
|
|
|
|
|
|
|
# |
|
282
|
|
|
|
|
|
|
sub _write_calculated_column_formula { |
|
283
|
|
|
|
|
|
|
|
|
284
|
3
|
|
|
3
|
|
7
|
my $self = shift; |
|
285
|
3
|
|
|
|
|
6
|
my $formula = shift; |
|
286
|
|
|
|
|
|
|
|
|
287
|
3
|
|
|
|
|
21
|
$self->xml_data_element( 'calculatedColumnFormula', $formula ); |
|
288
|
|
|
|
|
|
|
} |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
1; |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
__END__ |