element.
120
|
|
|
|
|
|
|
# |
121
|
|
|
|
|
|
|
sub _write_table { |
122
|
|
|
|
|
|
|
|
123
|
47
|
|
|
47
|
|
135
|
my $self = shift; |
124
|
47
|
|
|
|
|
198
|
my $schema = 'http://schemas.openxmlformats.org/'; |
125
|
47
|
|
|
|
|
168
|
my $xmlns = $schema . 'spreadsheetml/2006/main'; |
126
|
47
|
|
|
|
|
131
|
my $id = $self->{_properties}->{_id}; |
127
|
47
|
|
|
|
|
241
|
my $name = $self->{_properties}->{_name}; |
128
|
47
|
|
|
|
|
113
|
my $display_name = $self->{_properties}->{_name}; |
129
|
47
|
|
|
|
|
115
|
my $ref = $self->{_properties}->{_range}; |
130
|
47
|
|
|
|
|
105
|
my $totals_row_shown = $self->{_properties}->{_totals_row_shown}; |
131
|
47
|
|
|
|
|
202
|
my $header_row_count = $self->{_properties}->{_header_row_count}; |
132
|
|
|
|
|
|
|
|
133
|
47
|
|
|
|
|
214
|
my @attributes = ( |
134
|
|
|
|
|
|
|
'xmlns' => $xmlns, |
135
|
|
|
|
|
|
|
'id' => $id, |
136
|
|
|
|
|
|
|
'name' => $name, |
137
|
|
|
|
|
|
|
'displayName' => $display_name, |
138
|
|
|
|
|
|
|
'ref' => $ref, |
139
|
|
|
|
|
|
|
); |
140
|
|
|
|
|
|
|
|
141
|
47
|
100
|
|
|
|
214
|
push @attributes, ( 'headerRowCount' => 0 ) if !$header_row_count; |
142
|
|
|
|
|
|
|
|
143
|
47
|
100
|
|
|
|
166
|
if ( $totals_row_shown ) { |
144
|
10
|
|
|
|
|
85
|
push @attributes, ( 'totalsRowCount' => 1 ); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
else { |
147
|
37
|
|
|
|
|
104
|
push @attributes, ( 'totalsRowShown' => 0 ); |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
47
|
|
|
|
|
310
|
$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
|
|
108
|
my $self = shift; |
164
|
48
|
|
|
|
|
114
|
my $autofilter = $self->{_properties}->{_autofilter}; |
165
|
|
|
|
|
|
|
|
166
|
48
|
100
|
|
|
|
189
|
return unless $autofilter; |
167
|
|
|
|
|
|
|
|
168
|
44
|
|
|
|
|
175
|
my @attributes = ( 'ref' => $autofilter, ); |
169
|
|
|
|
|
|
|
|
170
|
44
|
|
|
|
|
272
|
$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
|
|
96
|
my $self = shift; |
183
|
47
|
|
|
|
|
100
|
my @columns = @{ $self->{_properties}->{_columns} }; |
|
47
|
|
|
|
|
188
|
|
184
|
|
|
|
|
|
|
|
185
|
47
|
|
|
|
|
172
|
my $count = scalar @columns; |
186
|
|
|
|
|
|
|
|
187
|
47
|
|
|
|
|
135
|
my @attributes = ( 'count' => $count, ); |
188
|
|
|
|
|
|
|
|
189
|
47
|
|
|
|
|
242
|
$self->xml_start_tag( 'tableColumns', @attributes ); |
190
|
|
|
|
|
|
|
|
191
|
47
|
|
|
|
|
203
|
for my $col_data ( @columns ) { |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# Write the tableColumn element. |
194
|
210
|
|
|
|
|
624
|
$self->_write_table_column( $col_data ); |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
|
197
|
47
|
|
|
|
|
250
|
$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
|
|
441
|
my $self = shift; |
210
|
211
|
|
|
|
|
371
|
my $col_data = shift; |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
my @attributes = ( |
213
|
|
|
|
|
|
|
'id' => $col_data->{_id}, |
214
|
|
|
|
|
|
|
'name' => $col_data->{_name}, |
215
|
211
|
|
|
|
|
651
|
); |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
211
|
100
|
|
|
|
609
|
if ( $col_data->{_total_string} ) { |
|
|
100
|
|
|
|
|
|
219
|
9
|
|
|
|
|
31
|
push @attributes, ( totalsRowLabel => $col_data->{_total_string} ); |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
elsif ( $col_data->{_total_function} ) { |
222
|
40
|
|
|
|
|
74
|
push @attributes, ( totalsRowFunction => $col_data->{_total_function} ); |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
|
226
|
211
|
100
|
|
|
|
490
|
if ( defined $col_data->{_format} ) { |
227
|
9
|
|
|
|
|
24
|
push @attributes, ( dataDxfId => $col_data->{_format} ); |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
211
|
100
|
|
|
|
392
|
if ( $col_data->{_formula} ) { |
231
|
3
|
|
|
|
|
11
|
$self->xml_start_tag( 'tableColumn', @attributes ); |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
# Write the calculatedColumnFormula element. |
234
|
3
|
|
|
|
|
13
|
$self->_write_calculated_column_formula( $col_data->{_formula} ); |
235
|
|
|
|
|
|
|
|
236
|
3
|
|
|
|
|
15
|
$self->xml_end_tag( 'tableColumn' ); |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
else { |
239
|
208
|
|
|
|
|
504
|
$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
|
|
110
|
my $self = shift; |
254
|
48
|
|
|
|
|
104
|
my $props = $self->{_properties}; |
255
|
|
|
|
|
|
|
|
256
|
48
|
|
|
|
|
129
|
my @attributes = (); |
257
|
48
|
|
|
|
|
142
|
my $name = $props->{_style}; |
258
|
48
|
|
|
|
|
119
|
my $show_first_column = $props->{_show_first_col}; |
259
|
48
|
|
|
|
|
85
|
my $show_last_column = $props->{_show_last_col}; |
260
|
48
|
|
|
|
|
99
|
my $show_row_stripes = $props->{_show_row_stripes}; |
261
|
48
|
|
|
|
|
96
|
my $show_column_stripes = $props->{_show_col_stripes}; |
262
|
|
|
|
|
|
|
|
263
|
48
|
100
|
33
|
|
|
443
|
if ( $name && $name ne '' && $name ne 'None' ) { |
|
|
|
66
|
|
|
|
|
264
|
47
|
|
|
|
|
125
|
push @attributes, ( 'name' => $name ); |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
|
267
|
48
|
|
|
|
|
102
|
push @attributes, ( 'showFirstColumn' => $show_first_column ); |
268
|
48
|
|
|
|
|
238
|
push @attributes, ( 'showLastColumn' => $show_last_column ); |
269
|
48
|
|
|
|
|
254
|
push @attributes, ( 'showRowStripes' => $show_row_stripes ); |
270
|
48
|
|
|
|
|
123
|
push @attributes, ( 'showColumnStripes' => $show_column_stripes ); |
271
|
|
|
|
|
|
|
|
272
|
48
|
|
|
|
|
188
|
$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
|
|
6
|
my $self = shift; |
285
|
3
|
|
|
|
|
6
|
my $formula = shift; |
286
|
|
|
|
|
|
|
|
287
|
3
|
|
|
|
|
20
|
$self->xml_data_element( 'calculatedColumnFormula', $formula ); |
288
|
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
1; |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
__END__ |