axlsx 1.1.4 → 1.3.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.
- data/.yardopts +6 -2
- data/CHANGELOG.md +72 -0
- data/README.md +114 -31
- data/Rakefile +11 -3
- data/examples/auto_filter.rb +16 -0
- data/examples/auto_filter.xlsx +0 -0
- data/examples/basic_charts.rb +58 -0
- data/examples/chart_colors.rb +17 -2
- data/examples/data_validation.rb +50 -0
- data/examples/example.rb +171 -60
- data/examples/example.xlsx +0 -0
- data/examples/example_streamed.xlsx +0 -0
- data/examples/extractive.pdf +0 -0
- data/examples/extractive.rb +3 -0
- data/examples/extractive.xlsx +0 -0
- data/examples/hyperlinks.rb +23 -0
- data/examples/hyperlinks.xlsx +0 -0
- data/examples/no-use_autowidth.xlsx +0 -0
- data/examples/page_setup.rb +11 -0
- data/examples/page_setup.xlsx +0 -0
- data/examples/scraping_html.rb +91 -0
- data/examples/shared_strings_example.xlsx +0 -0
- data/examples/sheet_protection.rb +10 -0
- data/examples/sheet_view.rb +34 -0
- data/examples/skydrive/axlsx.csv +1 -0
- data/examples/skydrive/axlsx.xlsx +0 -0
- data/examples/skydrive/real_example.rb +8 -8
- data/examples/sprk2012/Screen Shot 2012-09-11 at 10.42.06 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 11.07.48 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 8.31.50 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 9.23.27 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 9.32.06 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 9.33.35 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-11 at 9.46.44 PM.png +0 -0
- data/examples/sprk2012/Screen Shot 2012-09-12 at 5.07.23 PM.png +0 -0
- data/examples/sprk2012/basics.rb +11 -0
- data/examples/sprk2012/basics.xlsx +0 -0
- data/examples/sprk2012/gravatar.jpeg +0 -0
- data/examples/sprk2012/hair_club.jpg +0 -0
- data/examples/sprk2012/images.rb +9 -0
- data/examples/sprk2012/images.xlsx +0 -0
- data/examples/sprk2012/line_chart.rb +56 -0
- data/examples/sprk2012/line_chart.xlsx +0 -0
- data/examples/sprk2012/sprk2012.key +0 -0
- data/examples/sprk2012/styles.rb +20 -0
- data/examples/sprk2012/styles.xlsx +0 -0
- data/examples/styles.rb +62 -0
- data/examples/styles.xlsx +0 -0
- data/examples/two_cell_anchor_image.rb +11 -0
- data/lib/axlsx/content_type/content_type.rb +2 -0
- data/lib/axlsx/content_type/default.rb +30 -15
- data/lib/axlsx/content_type/override.rb +29 -14
- data/lib/axlsx/doc_props/app.rb +161 -104
- data/lib/axlsx/doc_props/core.rb +9 -5
- data/lib/axlsx/drawing/ax_data_source.rb +7 -6
- data/lib/axlsx/drawing/axis.rb +82 -36
- data/lib/axlsx/drawing/bar_3D_chart.rb +49 -45
- data/lib/axlsx/drawing/bar_series.rb +2 -1
- data/lib/axlsx/drawing/cat_axis.rb +43 -39
- data/lib/axlsx/drawing/chart.rb +65 -54
- data/lib/axlsx/drawing/d_lbls.rb +100 -0
- data/lib/axlsx/drawing/drawing.rb +20 -8
- data/lib/axlsx/drawing/graphic_frame.rb +2 -1
- data/lib/axlsx/drawing/line_3D_chart.rb +3 -10
- data/lib/axlsx/drawing/num_data.rb +2 -2
- data/lib/axlsx/drawing/num_data_source.rb +4 -1
- data/lib/axlsx/drawing/pic.rb +44 -4
- data/lib/axlsx/drawing/pie_3D_chart.rb +10 -7
- data/lib/axlsx/drawing/scatter_chart.rb +2 -8
- data/lib/axlsx/drawing/title.rb +21 -9
- data/lib/axlsx/drawing/two_cell_anchor.rb +46 -9
- data/lib/axlsx/drawing/view_3D.rb +42 -32
- data/lib/axlsx/drawing/vml_drawing.rb +42 -0
- data/lib/axlsx/drawing/vml_shape.rb +125 -0
- data/lib/axlsx/package.rb +43 -16
- data/lib/axlsx/rels/relationship.rb +3 -3
- data/lib/axlsx/rels/relationships.rb +1 -11
- data/lib/axlsx/stylesheet/gradient_fill.rb +1 -1
- data/lib/axlsx/stylesheet/styles.rb +11 -2
- data/lib/axlsx/stylesheet/table_style.rb +3 -3
- data/lib/axlsx/util/constants.rb +131 -2
- data/lib/axlsx/util/simple_typed_list.rb +18 -22
- data/lib/axlsx/util/validators.rb +100 -9
- data/lib/axlsx/version.rb +2 -7
- data/lib/axlsx/workbook/defined_name.rb +174 -0
- data/lib/axlsx/workbook/defined_names.rb +21 -0
- data/lib/axlsx/workbook/workbook.rb +70 -13
- data/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +77 -0
- data/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +102 -0
- data/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +253 -0
- data/lib/axlsx/workbook/worksheet/cell.rb +41 -8
- data/lib/axlsx/workbook/worksheet/col.rb +15 -0
- data/lib/axlsx/workbook/worksheet/cols.rb +20 -0
- data/lib/axlsx/workbook/worksheet/comment.rb +101 -0
- data/lib/axlsx/workbook/worksheet/comments.rb +85 -0
- data/lib/axlsx/workbook/worksheet/conditional_formattings.rb +25 -0
- data/lib/axlsx/workbook/worksheet/data_bar.rb +1 -1
- data/lib/axlsx/workbook/worksheet/data_validation.rb +245 -0
- data/lib/axlsx/workbook/worksheet/data_validations.rb +28 -0
- data/lib/axlsx/workbook/worksheet/date_time_converter.rb +1 -1
- data/lib/axlsx/workbook/worksheet/dimension.rb +65 -0
- data/lib/axlsx/workbook/worksheet/merged_cells.rb +35 -0
- data/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +47 -0
- data/lib/axlsx/workbook/worksheet/page_setup.rb +241 -0
- data/lib/axlsx/workbook/worksheet/pane.rb +144 -0
- data/lib/axlsx/workbook/worksheet/print_options.rb +63 -0
- data/lib/axlsx/workbook/worksheet/protected_range.rb +46 -0
- data/lib/axlsx/workbook/worksheet/protected_ranges.rb +34 -0
- data/lib/axlsx/workbook/worksheet/row.rb +36 -20
- data/lib/axlsx/workbook/worksheet/selection.rb +111 -0
- data/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +49 -0
- data/lib/axlsx/workbook/worksheet/sheet_data.rb +25 -0
- data/lib/axlsx/workbook/worksheet/sheet_pr.rb +107 -0
- data/lib/axlsx/workbook/worksheet/sheet_protection.rb +224 -0
- data/lib/axlsx/workbook/worksheet/sheet_view.rb +379 -0
- data/lib/axlsx/workbook/worksheet/table.rb +10 -3
- data/lib/axlsx/workbook/worksheet/table_style_info.rb +68 -0
- data/lib/axlsx/workbook/worksheet/tables.rb +31 -0
- data/lib/axlsx/workbook/worksheet/worksheet.rb +414 -254
- data/lib/axlsx/workbook/worksheet/worksheet_comments.rb +57 -0
- data/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +64 -0
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +101 -0
- data/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +38 -0
- data/lib/axlsx.rb +38 -16
- data/test/content_type/tc_content_type.rb +1 -6
- data/test/doc_props/tc_app.rb +31 -1
- data/test/doc_props/tc_core.rb +3 -1
- data/test/drawing/tc_axis.rb +38 -3
- data/test/drawing/tc_bar_3D_chart.rb +12 -12
- data/test/drawing/tc_bar_series.rb +1 -2
- data/test/drawing/tc_cat_axis.rb +3 -3
- data/test/drawing/tc_chart.rb +29 -9
- data/test/drawing/tc_d_lbls.rb +47 -0
- data/test/drawing/tc_drawing.rb +11 -5
- data/test/drawing/tc_hyperlink.rb +4 -5
- data/test/drawing/tc_line_series.rb +7 -3
- data/test/drawing/tc_num_data.rb +5 -1
- data/test/drawing/tc_pic.rb +22 -2
- data/test/drawing/tc_pie_3D_chart.rb +4 -8
- data/test/drawing/tc_pie_series.rb +7 -2
- data/test/drawing/tc_scatter_chart.rb +6 -1
- data/test/drawing/tc_scatter_series.rb +1 -1
- data/test/drawing/tc_series.rb +1 -1
- data/test/drawing/tc_title.rb +16 -0
- data/test/drawing/tc_two_cell_anchor.rb +1 -2
- data/test/drawing/tc_view_3D.rb +18 -18
- data/test/drawing/tc_vml_drawing.rb +25 -0
- data/test/drawing/tc_vml_shape.rb +100 -0
- data/test/rels/tc_relationship.rb +1 -0
- data/test/stylesheet/tc_gradient_fill.rb +8 -0
- data/test/stylesheet/tc_pattern_fill.rb +7 -1
- data/test/stylesheet/tc_styles.rb +16 -4
- data/test/stylesheet/tc_table_style.rb +8 -0
- data/test/stylesheet/tc_table_style_element.rb +10 -1
- data/test/tc_helper.rb +1 -0
- data/test/tc_package.rb +94 -17
- data/test/util/tc_simple_typed_list.rb +13 -0
- data/test/util/tc_validators.rb +101 -8
- data/test/workbook/tc_defined_name.rb +41 -0
- data/test/workbook/tc_workbook.rb +5 -3
- data/test/workbook/worksheet/auto_filter/tc_auto_filter.rb +38 -0
- data/test/workbook/worksheet/auto_filter/tc_filter_column.rb +76 -0
- data/test/workbook/worksheet/auto_filter/tc_filters.rb +50 -0
- data/test/workbook/worksheet/tc_cell.rb +53 -7
- data/test/workbook/worksheet/tc_col.rb +9 -0
- data/test/workbook/worksheet/tc_comment.rb +57 -0
- data/test/workbook/worksheet/tc_comments.rb +57 -0
- data/test/workbook/worksheet/tc_conditional_formatting.rb +44 -0
- data/test/workbook/worksheet/tc_data_bar.rb +1 -1
- data/test/workbook/worksheet/tc_data_validation.rb +265 -0
- data/test/workbook/worksheet/tc_page_set_up_pr.rb +15 -0
- data/test/workbook/worksheet/tc_page_setup.rb +143 -0
- data/test/workbook/worksheet/tc_pane.rb +94 -0
- data/test/workbook/worksheet/tc_print_options.rb +72 -0
- data/test/workbook/worksheet/tc_protected_range.rb +17 -0
- data/test/workbook/worksheet/tc_row.rb +32 -14
- data/test/workbook/worksheet/tc_selection.rb +94 -0
- data/test/workbook/worksheet/tc_sheet_calc_pr.rb +18 -0
- data/test/workbook/worksheet/tc_sheet_pr.rb +27 -0
- data/test/workbook/worksheet/tc_sheet_protection.rb +117 -0
- data/test/workbook/worksheet/tc_sheet_view.rb +214 -0
- data/test/workbook/worksheet/{table/tc_table.rb → tc_table.rb} +9 -12
- data/test/workbook/worksheet/tc_table_style_info.rb +53 -0
- data/test/workbook/worksheet/tc_worksheet.rb +155 -51
- data/test/workbook/worksheet/tc_worksheet_hyperlink.rb +64 -0
- metadata +194 -81
- data/examples/#extractive.csv# +0 -0
- data/examples/#extractive.rb# +0 -45
- data/examples/chart_colors.rb~ +0 -0
- data/examples/chart_colors.xlsx +0 -0
- data/examples/colored_series_data.xlsx +0 -0
- data/examples/conditional_formatting/getting_barred.xlsx +0 -0
- data/examples/example.csv +0 -1000
- data/examples/extractive.csv +0 -1
- data/examples/extractive.csv~ +0 -1
- data/examples/extractive.rb~ +0 -3
- data/examples/stack.rb +0 -21
- data/examples/stack.rb~ +0 -27
- data/examples/stack.xlsx +0 -0
- data/examples/~$chart_colors.xlsx +0 -0
- data/examples/~$extractive.xlsx +0 -0
- data/lib/axlsx/drawing/ax_data_source.rb~ +0 -55
- data/lib/axlsx/drawing/data_source.rb~ +0 -51
- data/lib/axlsx/drawing/hlink_click.rb~ +0 -0
- data/lib/axlsx/drawing/hyperlink.rb~ +0 -64
- data/lib/axlsx/drawing/num_data.rb~ +0 -51
- data/lib/axlsx/drawing/num_data_source.rb~ +0 -54
- data/lib/axlsx/drawing/num_val.rb~ +0 -40
- data/lib/axlsx/drawing/picture_locking.rb~ +0 -36
- data/lib/axlsx/drawing/ref.rb~ +0 -41
- data/lib/axlsx/drawing/str_data.rb~ +0 -58
- data/lib/axlsx/drawing/str_val.rb~ +0 -35
- data/lib/axlsx/util/cbf.rb +0 -333
- data/lib/axlsx/util/cfb.rb~ +0 -201
- data/lib/axlsx/util/font_tables.rb~ +0 -0
- data/lib/axlsx/util/ms_off_crypto.rb +0 -189
- data/lib/axlsx/util/ms_off_crypto.rb~ +0 -3
- data/lib/axlsx/util/ms_offcrypto.rb~ +0 -0
- data/lib/axlsx/util/parser.rb~ +0 -6
- data/lib/axlsx/util/storage.rb~ +0 -0
- data/lib/axlsx/workbook/shared_strings_table.rb~ +0 -69
- data/lib/axlsx/workbook/worksheet/cfvo.rb~ +0 -0
- data/lib/axlsx/workbook/worksheet/col.rb~ +0 -0
- data/lib/axlsx/workbook/worksheet/color_scale.rb~ +0 -46
- data/lib/axlsx/workbook/worksheet/data_bar.rb~ +0 -0
- data/lib/axlsx/workbook/worksheet/icon_set.rb~ +0 -95
- data/lib/axlsx/workbook/worksheet/shared_strings_table.rb~ +0 -0
- data/lib/axlsx/workbook/worksheet/table.rb~ +0 -97
- data/lib/schema/dc.xsd~ +0 -118
- data/lib/schema/dcterms.xsd~ +0 -331
- data/lib/schema/opc-coreProperties.xsd~ +0 -50
- data/test/drawing/tc_data_source.rb~ +0 -30
- data/test/drawing/tc_num_data.rb~ +0 -35
- data/test/drawing/tc_num_val.rb~ +0 -29
- data/test/drawing/tc_str_data.rb~ +0 -30
- data/test/drawing/tc_str_val.rb~ +0 -26
- data/test/workbook/worksheet/table/tc_table.rb~ +0 -72
- data/test/workbook/worksheet/tc_cfvo.rb~ +0 -20
- data/test/workbook/worksheet/tc_col.rb~ +0 -10
- data/test/workbook/worksheet/tc_color_scale.rb~ +0 -0
- data/test/workbook/worksheet/tc_data_bar.rb~ +0 -0
- data/test/workbook/worksheet/tc_icon_set.rb~ +0 -0
data/lib/axlsx/version.rb
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
1
|
module Axlsx
|
|
3
2
|
|
|
4
|
-
# The version
|
|
5
|
-
|
|
6
|
-
# it will use the gemspec, which preloads this constant for the gem's version.
|
|
7
|
-
# We check to make sure that it has not already been loaded
|
|
8
|
-
VERSION="1.1.4" unless defined? Axlsx::VERSION
|
|
9
|
-
|
|
3
|
+
# The current version
|
|
4
|
+
VERSION = "1.3.1"
|
|
10
5
|
end
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# <definedNames>
|
|
2
|
+
# <definedName name="_xlnm.Print_Titles" localSheetId="0">Sheet1!$1:$1</definedName>
|
|
3
|
+
# </definedNames>
|
|
4
|
+
|
|
5
|
+
#<xsd:complexType name="CT_DefinedName">
|
|
6
|
+
# <xsd:simpleContent>
|
|
7
|
+
# <xsd:extension base="ST_Formula">
|
|
8
|
+
# <xsd:attribute name="name" type="s:ST_Xstring" use="required"/>
|
|
9
|
+
# <xsd:attribute name="comment" type="s:ST_Xstring" use="optional"/>
|
|
10
|
+
# <xsd:attribute name="customMenu" type="s:ST_Xstring" use="optional"/>
|
|
11
|
+
# <xsd:attribute name="description" type="s:ST_Xstring" use="optional"/>
|
|
12
|
+
# <xsd:attribute name="help" type="s:ST_Xstring" use="optional"/>
|
|
13
|
+
# <xsd:attribute name="statusBar" type="s:ST_Xstring" use="optional"/>
|
|
14
|
+
# <xsd:attribute name="localSheetId" type="xsd:unsignedInt" use="optional"/>
|
|
15
|
+
# <xsd:attribute name="hidden" type="xsd:boolean" use="optional" default="false"/>
|
|
16
|
+
# <xsd:attribute name="function" type="xsd:boolean" use="optional" default="false"/>
|
|
17
|
+
# <xsd:attribute name="vbProcedure" type="xsd:boolean" use="optional" default="false"/>
|
|
18
|
+
# <xsd:attribute name="xlm" type="xsd:boolean" use="optional" default="false"/>
|
|
19
|
+
# <xsd:attribute name="functionGroupId" type="xsd:unsignedInt" use="optional"/>
|
|
20
|
+
# <xsd:attribute name="shortcutKey" type="s:ST_Xstring" use="optional"/>
|
|
21
|
+
# <xsd:attribute name="publishToServer" type="xsd:boolean" use="optional" default="false"/>
|
|
22
|
+
# <xsd:attribute name="workbookParameter" type="xsd:boolean" use="optional" default="false"/>
|
|
23
|
+
# </xsd:extenstion>
|
|
24
|
+
# </xsd:simpleContent>
|
|
25
|
+
|
|
26
|
+
module Axlsx
|
|
27
|
+
# This element defines the defined names that are defined within this workbook.
|
|
28
|
+
# Defined names are descriptive text that is used to represents a cell, range of cells, formula, or constant value.
|
|
29
|
+
# Use easy-to-understand names, such as Products, to refer to hard to understand ranges, such as Sales!C20:C30.
|
|
30
|
+
# A defined name in a formula can make it easier to understand the purpose of the formula.
|
|
31
|
+
# @example
|
|
32
|
+
# The formula =SUM(FirstQuarterSales) might be easier to identify than =SUM(C20:C30
|
|
33
|
+
#
|
|
34
|
+
# Names are available to any sheet.
|
|
35
|
+
# @example
|
|
36
|
+
# If the name ProjectedSales refers to the range A20:A30 on the first worksheet in a workbook,
|
|
37
|
+
# you can use the name ProjectedSales on any other sheet in the same workbook to refer to range A20:A30 on the first worksheet.
|
|
38
|
+
# Names can also be used to represent formulas or values that do not change (constants).
|
|
39
|
+
#
|
|
40
|
+
# @example
|
|
41
|
+
# The name SalesTax can be used to represent the sales tax amount (such as 6.2 percent) applied to sales transactions.
|
|
42
|
+
# You can also link to a defined name in another workbook, or define a name that refers to cells in another workbook.
|
|
43
|
+
#
|
|
44
|
+
# @example
|
|
45
|
+
# The formula =SUM(Sales.xls!ProjectedSales) refers to the named range ProjectedSales in the workbook named Sales.
|
|
46
|
+
# A compliant producer or consumer considers a defined name in the range A1-XFD1048576 to be an error.
|
|
47
|
+
# All other names outside this range can be defined as names and overrides a cell reference if an ambiguity exists.
|
|
48
|
+
#
|
|
49
|
+
# @example
|
|
50
|
+
# For clarification: LOG10 is always a cell reference, LOG10() is always formula, LOGO1000 can be a defined name that overrides a cell reference.
|
|
51
|
+
class DefinedName
|
|
52
|
+
# creates a new DefinedName.
|
|
53
|
+
# @param [String] formula - the formula the defined name references
|
|
54
|
+
# @param [Hash] options - A hash of key/value pairs that will be mapped to this instances attributes.
|
|
55
|
+
#
|
|
56
|
+
# @option [String] name - Specifies the name that appears in the user interface for the defined name.
|
|
57
|
+
# This attribute is required.
|
|
58
|
+
# The following built-in names are defined in this SpreadsheetML specification:
|
|
59
|
+
# Print
|
|
60
|
+
# _xlnm.Print_Area: this defined name specifies the workbook's print area.
|
|
61
|
+
# _xlnm.Print_Titles: this defined name specifies the row(s) or column(s) to repeat
|
|
62
|
+
# the top of each printed page.
|
|
63
|
+
# Filter & Advanced Filter
|
|
64
|
+
# _xlnm.Criteria: this defined name refers to a range containing the criteria values
|
|
65
|
+
# to be used in applying an advanced filter to a range of data.
|
|
66
|
+
# _xlnm._FilterDatabase: can be one of the following
|
|
67
|
+
# a. this defined name refers to a range to which an advanced filter has been
|
|
68
|
+
# applied. This represents the source data range, unfiltered.
|
|
69
|
+
# b. This defined name refers to a range to which an AutoFilter has been
|
|
70
|
+
# applied.
|
|
71
|
+
# _xlnm.Extract: this defined name refers to the range containing the filtered output
|
|
72
|
+
# values resulting from applying an advanced filter criteria to a source range.
|
|
73
|
+
# Miscellaneous
|
|
74
|
+
# _xlnm.Consolidate_Area: the defined name refers to a consolidation area.
|
|
75
|
+
# _xlnm.Database: the range specified in the defined name is from a database data source.
|
|
76
|
+
# _xlnm.Sheet_Title: the defined name refers to a sheet title.
|
|
77
|
+
# @option [String] comment - A comment to optionally associate with the name
|
|
78
|
+
# @option [String] custom_menu - The menu text for the defined name
|
|
79
|
+
# @option [String] description - An optional description for the defined name
|
|
80
|
+
# @option [String] help - The help topic to display for this defined name
|
|
81
|
+
# @option [String] status_bar - The text to display on the application status bar when this defined name has focus
|
|
82
|
+
# @option [String] local_sheet_id - Specifies the sheet index in this workbook where data from an external reference is displayed
|
|
83
|
+
# @option [Boolean] hidden - Specifies a boolean value that indicates whether the defined name is hidden in the user interface.
|
|
84
|
+
# @option [Boolean] function - Specifies a boolean value that indicates that the defined name refers to a user-defined function.
|
|
85
|
+
# This attribute is used when there is an add-in or other code project associated with the file.
|
|
86
|
+
# @option [Boolean] vb_proceedure - Specifies a boolean value that indicates whether the defined name is related to an external function, command, or other executable code.
|
|
87
|
+
# @option [Boolean] xlm - Specifies a boolean value that indicates whether the defined name is related to an external function, command, or other executable code.
|
|
88
|
+
# @option [Integer] function_group_id - Specifies the function group index if the defined name refers to a function.
|
|
89
|
+
# The function group defines the general category for the function.
|
|
90
|
+
# This attribute is used when there is an add-in or other code project associated with the file.
|
|
91
|
+
# See Open Office XML Part 1 for more info.
|
|
92
|
+
# @option [String] short_cut_key - Specifies the keyboard shortcut for the defined name.
|
|
93
|
+
# @option [Boolean] publish_to_server - Specifies a boolean value that indicates whether the defined name is included in the
|
|
94
|
+
# version of the workbook that is published to or rendered on a Web or application server.
|
|
95
|
+
# @option [Boolean] workbook_parameter - Specifies a boolean value that indicates that the name is used as a workbook parameter on a
|
|
96
|
+
# version of the workbook that is published to or rendered on a Web or application server.
|
|
97
|
+
def initialize(formula, options={})
|
|
98
|
+
@formula = formula
|
|
99
|
+
options.each do |o|
|
|
100
|
+
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
attr_reader :local_sheet_id
|
|
104
|
+
|
|
105
|
+
# The local sheet index (0-based)
|
|
106
|
+
# @param [Integer] value the unsinged integer index of the sheet this defined_name applies to.
|
|
107
|
+
def local_sheet_id=(value)
|
|
108
|
+
Axlsx::validate_unsigned_int(value)
|
|
109
|
+
@local_sheet_id = value
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# string attributes that will be added when this class is evaluated
|
|
113
|
+
STRING_ATTRIBUTES = [:short_cut_key, :status_bar, :help, :description, :custom_menu, :comment]
|
|
114
|
+
|
|
115
|
+
# boolean attributes that will be added when this class is evaluated
|
|
116
|
+
BOOLEAN_ATTRIBUTES = [:workbook_parameter, :publish_to_server, :xlm, :vb_proceedure, :function, :hidden]
|
|
117
|
+
|
|
118
|
+
# Dynamically create string attribute accessors
|
|
119
|
+
STRING_ATTRIBUTES.each do |attr|
|
|
120
|
+
class_eval %{
|
|
121
|
+
# The #{attr} attribute reader
|
|
122
|
+
# @return [String]
|
|
123
|
+
attr_reader :#{attr}
|
|
124
|
+
|
|
125
|
+
# The #{attr} writer
|
|
126
|
+
# @param [String] value The value to assign to #{attr}
|
|
127
|
+
# @return [String]
|
|
128
|
+
def #{attr}=(value)
|
|
129
|
+
Axlsx::validate_string(value)
|
|
130
|
+
@#{attr}= value
|
|
131
|
+
end
|
|
132
|
+
}
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Dynamically create boolean attribute accessors
|
|
136
|
+
BOOLEAN_ATTRIBUTES.each do |attr|
|
|
137
|
+
class_eval %{
|
|
138
|
+
# The #{attr} attribute reader
|
|
139
|
+
# @return [Boolean]
|
|
140
|
+
attr_reader :#{attr}
|
|
141
|
+
|
|
142
|
+
# The #{attr} writer
|
|
143
|
+
# @param [Boolean] value The value to assign to #{attr}
|
|
144
|
+
# @return [Boolean]
|
|
145
|
+
def #{attr}=(value)
|
|
146
|
+
Axlsx::validate_boolean(value)
|
|
147
|
+
@#{attr} = value
|
|
148
|
+
end
|
|
149
|
+
}
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
attr_reader :name
|
|
153
|
+
# The name of this defined name. Please refer to the class documentation for more information
|
|
154
|
+
def name=(value)
|
|
155
|
+
Axlsx::RestrictionValidator.validate 'DefinedName.name', %w(_xlnm.Print_Area _xlnm.Print_Titles _xlnm.Criteria _xlnm._FilterDatabase _xlnm.Extract _xlnm.Consolidate_Area _xlnm.Database _xlnm.Sheet_Title), value
|
|
156
|
+
@name = value
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# The formula this defined name references
|
|
160
|
+
attr_reader :formula
|
|
161
|
+
|
|
162
|
+
def to_xml_string(str='')
|
|
163
|
+
raise ArgumentError, 'you must specify the name for this defined name. Please read the documentation for Axlsx::DefinedName for more details' unless name
|
|
164
|
+
str << '<definedName'
|
|
165
|
+
instance_values.each do |name, value|
|
|
166
|
+
unless name == 'formula'
|
|
167
|
+
str << ' ' << Axlsx::camel(name, false) << "='#{value}'"
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
str << '>' << @formula
|
|
171
|
+
str << '</definedName>'
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Axlsx
|
|
2
|
+
# a simple types list of DefinedName objects
|
|
3
|
+
class DefinedNames < SimpleTypedList
|
|
4
|
+
|
|
5
|
+
# creates the DefinedNames object
|
|
6
|
+
def initialize
|
|
7
|
+
super DefinedName
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Serialize to xml
|
|
11
|
+
# @param [String] str
|
|
12
|
+
# @return [String]
|
|
13
|
+
def to_xml_string(str = '')
|
|
14
|
+
return if @list.empty?
|
|
15
|
+
str << "<definedNames>"
|
|
16
|
+
each { |defined_name| defined_name.to_xml_string(str) }
|
|
17
|
+
str << '</definedNames>'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
@@ -1,21 +1,48 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
module Axlsx
|
|
3
|
-
|
|
3
|
+
require 'axlsx/workbook/worksheet/sheet_calc_pr.rb'
|
|
4
|
+
require 'axlsx/workbook/worksheet/auto_filter/auto_filter.rb'
|
|
4
5
|
require 'axlsx/workbook/worksheet/date_time_converter.rb'
|
|
6
|
+
require 'axlsx/workbook/worksheet/protected_range.rb'
|
|
7
|
+
require 'axlsx/workbook/worksheet/protected_ranges.rb'
|
|
5
8
|
require 'axlsx/workbook/worksheet/cell.rb'
|
|
6
9
|
require 'axlsx/workbook/worksheet/page_margins.rb'
|
|
10
|
+
require 'axlsx/workbook/worksheet/page_set_up_pr.rb'
|
|
11
|
+
require 'axlsx/workbook/worksheet/page_setup.rb'
|
|
12
|
+
require 'axlsx/workbook/worksheet/print_options.rb'
|
|
7
13
|
require 'axlsx/workbook/worksheet/cfvo.rb'
|
|
8
14
|
require 'axlsx/workbook/worksheet/color_scale.rb'
|
|
9
15
|
require 'axlsx/workbook/worksheet/data_bar.rb'
|
|
10
16
|
require 'axlsx/workbook/worksheet/icon_set.rb'
|
|
11
17
|
require 'axlsx/workbook/worksheet/conditional_formatting.rb'
|
|
12
18
|
require 'axlsx/workbook/worksheet/conditional_formatting_rule.rb'
|
|
19
|
+
require 'axlsx/workbook/worksheet/conditional_formattings.rb'
|
|
13
20
|
require 'axlsx/workbook/worksheet/row.rb'
|
|
14
21
|
require 'axlsx/workbook/worksheet/col.rb'
|
|
22
|
+
require 'axlsx/workbook/worksheet/cols.rb'
|
|
23
|
+
require 'axlsx/workbook/worksheet/comments.rb'
|
|
24
|
+
require 'axlsx/workbook/worksheet/comment.rb'
|
|
25
|
+
require 'axlsx/workbook/worksheet/merged_cells.rb'
|
|
26
|
+
require 'axlsx/workbook/worksheet/sheet_protection.rb'
|
|
27
|
+
require 'axlsx/workbook/worksheet/sheet_pr.rb'
|
|
28
|
+
require 'axlsx/workbook/worksheet/dimension.rb'
|
|
29
|
+
require 'axlsx/workbook/worksheet/sheet_data.rb'
|
|
30
|
+
require 'axlsx/workbook/worksheet/worksheet_drawing.rb'
|
|
31
|
+
require 'axlsx/workbook/worksheet/worksheet_comments.rb'
|
|
32
|
+
require 'axlsx/workbook/worksheet/worksheet_hyperlink'
|
|
33
|
+
require 'axlsx/workbook/worksheet/worksheet_hyperlinks'
|
|
15
34
|
require 'axlsx/workbook/worksheet/worksheet.rb'
|
|
16
35
|
require 'axlsx/workbook/shared_strings_table.rb'
|
|
36
|
+
require 'axlsx/workbook/defined_name.rb'
|
|
37
|
+
require 'axlsx/workbook/defined_names.rb'
|
|
38
|
+
require 'axlsx/workbook/worksheet/table_style_info.rb'
|
|
17
39
|
require 'axlsx/workbook/worksheet/table.rb'
|
|
18
|
-
|
|
40
|
+
require 'axlsx/workbook/worksheet/tables.rb'
|
|
41
|
+
require 'axlsx/workbook/worksheet/data_validation.rb'
|
|
42
|
+
require 'axlsx/workbook/worksheet/data_validations.rb'
|
|
43
|
+
require 'axlsx/workbook/worksheet/sheet_view.rb'
|
|
44
|
+
require 'axlsx/workbook/worksheet/pane.rb'
|
|
45
|
+
require 'axlsx/workbook/worksheet/selection.rb'
|
|
19
46
|
# The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles.
|
|
20
47
|
# The following parts of the Office Open XML spreadsheet specification are not implimented in this version.
|
|
21
48
|
#
|
|
@@ -82,6 +109,9 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
82
109
|
# @return [SimpleTypedList]
|
|
83
110
|
attr_reader :drawings
|
|
84
111
|
|
|
112
|
+
# pretty sure this two are always empty and can be removed.
|
|
113
|
+
|
|
114
|
+
|
|
85
115
|
# A colllection of tables associated with this workbook
|
|
86
116
|
# @note The recommended way to manage drawings is Worksheet#add_table
|
|
87
117
|
# @see Worksheet#add_table
|
|
@@ -90,6 +120,23 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
90
120
|
attr_reader :tables
|
|
91
121
|
|
|
92
122
|
|
|
123
|
+
# A collection of defined names for this workbook
|
|
124
|
+
# @note The recommended way to manage defined names is Workbook#add_defined_name
|
|
125
|
+
# @see DefinedName
|
|
126
|
+
# @return [DefinedNames]
|
|
127
|
+
def defined_names
|
|
128
|
+
@defined_names ||= DefinedNames.new
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# A collection of comments associated with this workbook
|
|
132
|
+
# @note The recommended way to manage comments is WOrksheet#add_comment
|
|
133
|
+
# @see Worksheet#add_comment
|
|
134
|
+
# @see Comment
|
|
135
|
+
# @return [Comments]
|
|
136
|
+
def comments
|
|
137
|
+
worksheets.map { |sheet| sheet.comments }.compact
|
|
138
|
+
end
|
|
139
|
+
|
|
93
140
|
# The styles associated with this workbook
|
|
94
141
|
# @note The recommended way to manage styles is Styles#add_style
|
|
95
142
|
# @see Style#add_style
|
|
@@ -123,7 +170,11 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
123
170
|
@drawings = SimpleTypedList.new Drawing
|
|
124
171
|
@charts = SimpleTypedList.new Chart
|
|
125
172
|
@images = SimpleTypedList.new Pic
|
|
173
|
+
# Are these even used????? Check package serialization parts
|
|
126
174
|
@tables = SimpleTypedList.new Table
|
|
175
|
+
@comments = SimpleTypedList.new Comments
|
|
176
|
+
|
|
177
|
+
|
|
127
178
|
@use_autowidth = true
|
|
128
179
|
|
|
129
180
|
self.date1904= !options[:date1904].nil? && options[:date1904]
|
|
@@ -146,12 +197,14 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
146
197
|
def self.date1904() @@date1904; end
|
|
147
198
|
|
|
148
199
|
# Indicates if the workbook should use autowidths or not.
|
|
149
|
-
#
|
|
200
|
+
# @note This gem no longer depends on RMagick for autowidth
|
|
201
|
+
# calculation. Thus the performance benefits of turning this off are
|
|
202
|
+
# marginal unless you are creating a very large sheet.
|
|
150
203
|
# @return [Boolean]
|
|
151
204
|
def use_autowidth() @use_autowidth; end
|
|
152
205
|
|
|
153
206
|
# see @use_autowidth
|
|
154
|
-
def use_autowidth=(v) Axlsx::validate_boolean v; @use_autowidth = v; end
|
|
207
|
+
def use_autowidth=(v=true) Axlsx::validate_boolean v; @use_autowidth = v; end
|
|
155
208
|
|
|
156
209
|
# Adds a worksheet to this workbook
|
|
157
210
|
# @return [Worksheet]
|
|
@@ -164,6 +217,14 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
164
217
|
worksheet
|
|
165
218
|
end
|
|
166
219
|
|
|
220
|
+
# Adds a defined name to this workbook
|
|
221
|
+
# @return [DefinedName]
|
|
222
|
+
# @param [String] formula @see DefinedName
|
|
223
|
+
# @param [Hash] options @see DefinedName
|
|
224
|
+
def add_defined_name(formula, options)
|
|
225
|
+
defined_names << DefinedName.new(formula, options)
|
|
226
|
+
end
|
|
227
|
+
|
|
167
228
|
# The workbook relationships. This is managed automatically by the workbook
|
|
168
229
|
# @return [Relationships]
|
|
169
230
|
def relationships
|
|
@@ -205,17 +266,13 @@ require 'axlsx/workbook/worksheet/table.rb'
|
|
|
205
266
|
str << '<workbookPr date1904="' << @@date1904.to_s << '"/>'
|
|
206
267
|
str << '<sheets>'
|
|
207
268
|
@worksheets.each_with_index do |sheet, index|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
str << '<definedNames>'
|
|
212
|
-
@worksheets.each_with_index do |sheet, index|
|
|
213
|
-
if sheet.auto_filter
|
|
214
|
-
str << '<definedName name="_xlnm._FilterDatabase" localSheetId="' << index.to_s << '" hidden="1">'
|
|
215
|
-
str << sheet.abs_auto_filter << '</definedName>'
|
|
269
|
+
str << '<sheet name="' << sheet.name << '" sheetId="' << (index+1).to_s << '" r:id="' << sheet.rId << '"/>'
|
|
270
|
+
if defined_name = sheet.auto_filter.defined_name
|
|
271
|
+
add_defined_name defined_name, :name => '_xlnm._FilterDatabase', :local_sheet_id => index, :hidden => 1
|
|
216
272
|
end
|
|
217
273
|
end
|
|
218
|
-
str << '</
|
|
274
|
+
str << '</sheets>'
|
|
275
|
+
defined_names.to_xml_string(str)
|
|
219
276
|
str << '</workbook>'
|
|
220
277
|
end
|
|
221
278
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
require 'axlsx/workbook/worksheet/auto_filter/filter_column.rb'
|
|
3
|
+
require 'axlsx/workbook/worksheet/auto_filter/filters.rb'
|
|
4
|
+
|
|
5
|
+
module Axlsx
|
|
6
|
+
|
|
7
|
+
#This class represents an auto filter range in a worksheet
|
|
8
|
+
class AutoFilter
|
|
9
|
+
|
|
10
|
+
# creates a new Autofilter object
|
|
11
|
+
# @param [Worksheet] worksheet
|
|
12
|
+
def initialize(worksheet)
|
|
13
|
+
raise ArgumentError, 'you must provide a worksheet' unless worksheet.is_a?(Worksheet)
|
|
14
|
+
@worksheet = worksheet
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
attr_reader :worksheet
|
|
18
|
+
|
|
19
|
+
# The range the autofilter should be applied to.
|
|
20
|
+
# This should be a string like 'A1:B8'
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :range
|
|
23
|
+
|
|
24
|
+
# the formula for the defined name required for this auto filter
|
|
25
|
+
# This prepends the worksheet name to the absolute cell reference
|
|
26
|
+
# e.g. A1:B2 -> 'Sheet1'!$A$1:$B$2
|
|
27
|
+
# @return [String]
|
|
28
|
+
def defined_name
|
|
29
|
+
return unless range
|
|
30
|
+
Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name)})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# A collection of filterColumns for this auto_filter
|
|
34
|
+
# @return [SimpleTypedList]
|
|
35
|
+
def columns
|
|
36
|
+
@columns ||= SimpleTypedList.new FilterColumn
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Adds a filter column. This is the recommended way to create and manage filter columns for your autofilter.
|
|
40
|
+
# In addition to the require id and type parameters, options will be passed to the filter column during instantiation.
|
|
41
|
+
# @param [String] col_id Zero-based index indicating the AutoFilter column to which this filter information applies.
|
|
42
|
+
# @param [Symbol] filter_type A symbol representing one of the supported filter types.
|
|
43
|
+
# @param [Hash] options a hash of options to pass into the generated filter
|
|
44
|
+
# @return [FilterColumn]
|
|
45
|
+
def add_column(col_id, filter_type, options = {})
|
|
46
|
+
columns << FilterColumn.new(col_id, filter_type, options)
|
|
47
|
+
columns.last
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# actually performs the filtering of rows who's cells do not
|
|
51
|
+
# match the filter.
|
|
52
|
+
def apply
|
|
53
|
+
first_cell, last_cell = range.split(':')
|
|
54
|
+
start_point = Axlsx::name_to_indices(first_cell)
|
|
55
|
+
end_point = Axlsx::name_to_indices(last_cell)
|
|
56
|
+
# The +1 is so we skip the header row with the filter drop downs
|
|
57
|
+
rows = worksheet.rows[(start_point.last+1)..end_point.last] || []
|
|
58
|
+
|
|
59
|
+
column_offset = start_point.first
|
|
60
|
+
columns.each do |column|
|
|
61
|
+
rows.each do |row|
|
|
62
|
+
next if row.hidden
|
|
63
|
+
column.apply(row, column_offset)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
# serialize the object
|
|
68
|
+
# @return [String]
|
|
69
|
+
def to_xml_string(str='')
|
|
70
|
+
return unless range
|
|
71
|
+
str << "<autoFilter ref='#{range}'>"
|
|
72
|
+
columns.each { |filter_column| filter_column.to_xml_string(str) }
|
|
73
|
+
str << "</autoFilter>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
module Axlsx
|
|
2
|
+
# The filterColumn collection identifies a particular column in the AutoFilter
|
|
3
|
+
# range and specifies filter information that has been applied to this column.
|
|
4
|
+
# If a column in the AutoFilter range has no criteria specified,
|
|
5
|
+
# then there is no corresponding filterColumn collection expressed for that column.
|
|
6
|
+
class FilterColumn
|
|
7
|
+
|
|
8
|
+
# Allowed filters
|
|
9
|
+
FILTERS = [:filters] #, :top10, :custom_filters, :dynamic_filters, :color_filters, :icon_filters]
|
|
10
|
+
|
|
11
|
+
# Creates a new FilterColumn object
|
|
12
|
+
# @note This class yeilds its filter object as that is where the vast majority of processing will be done
|
|
13
|
+
# @param [Integer|Cell] col_id The zero based index for the column to which this filter will be applied
|
|
14
|
+
# @param [Symbol] filter_type The symbolized class name of the filter to apply to this column.
|
|
15
|
+
# @param [Hash] options options for this object and the filter
|
|
16
|
+
# @option [Boolean] hidden_button @see hidden_button
|
|
17
|
+
# @option [Boolean] show_button @see show_button
|
|
18
|
+
def initialize(col_id, filter_type, options = {})
|
|
19
|
+
RestrictionValidator.validate 'FilterColumn.filter', FILTERS, filter_type
|
|
20
|
+
#Axlsx::validate_unsigned_int(col_id)
|
|
21
|
+
self.col_id = col_id
|
|
22
|
+
options.each do |o|
|
|
23
|
+
self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
|
|
24
|
+
end
|
|
25
|
+
@filter = Axlsx.const_get(Axlsx.camel(filter_type)).new(options)
|
|
26
|
+
yield @filter if block_given?
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Zero-based index indicating the AutoFilter column to which this filter information applies.
|
|
30
|
+
# @return [Integer]
|
|
31
|
+
attr_reader :col_id
|
|
32
|
+
|
|
33
|
+
# The actual filter being dealt with here
|
|
34
|
+
# This could be any one of the allowed filter types
|
|
35
|
+
attr_reader :filter
|
|
36
|
+
|
|
37
|
+
# Flag indicating whether the filter button is visible.
|
|
38
|
+
# When the cell containing the filter button is merged with another cell,
|
|
39
|
+
# the filter button can be hidden, and not drawn.
|
|
40
|
+
# @return [Boolean]
|
|
41
|
+
def show_button
|
|
42
|
+
@show_button ||= true
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Flag indicating whether the AutoFilter button for this column is hidden.
|
|
46
|
+
# @return [Boolean]
|
|
47
|
+
def hidden_button
|
|
48
|
+
@hidden_button ||= false
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Sets the col_id attribute for this filter column.
|
|
52
|
+
# @param [Integer | Cell] column_index The zero based index of the column to which this filter applies.
|
|
53
|
+
# When you specify a cell, the column index will be read off the cell
|
|
54
|
+
# @return [Integer]
|
|
55
|
+
def col_id=(column_index)
|
|
56
|
+
column_index = column_index.col if column_index.is_a?(Cell)
|
|
57
|
+
Axlsx.validate_unsigned_int column_index
|
|
58
|
+
@col_id = column_index
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Apply the filters for this column
|
|
62
|
+
# @param [Array] row A row from a worksheet that needs to be
|
|
63
|
+
# filtered.
|
|
64
|
+
def apply(row, offset)
|
|
65
|
+
row.hidden = @filter.apply(row.cells[offset+col_id.to_i])
|
|
66
|
+
end
|
|
67
|
+
# @param [Boolean] hidden Flag indicating whether the AutoFilter button for this column is hidden.
|
|
68
|
+
# @return [Boolean]
|
|
69
|
+
def hidden_button=(hidden)
|
|
70
|
+
Axlsx.validate_boolean hidden
|
|
71
|
+
@hidden_button = hidden
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Flag indicating whether the AutoFilter button is show. This is
|
|
75
|
+
# undocumented in the spec, but exists in the schema file as an
|
|
76
|
+
# optional attribute.
|
|
77
|
+
# @param [Boolean] show Show or hide the button
|
|
78
|
+
# @return [Boolean]
|
|
79
|
+
def show_button=(show)
|
|
80
|
+
Axlsx.validate_boolean show
|
|
81
|
+
@show_botton = show
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Serialize the object to xml
|
|
85
|
+
def to_xml_string(str='')
|
|
86
|
+
str << "<filterColumn #{serialized_attributes}>"
|
|
87
|
+
@filter.to_xml_string(str)
|
|
88
|
+
str << "</filterColumn>"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
private
|
|
92
|
+
|
|
93
|
+
def serialized_attributes(str='')
|
|
94
|
+
instance_values.each do |key, value|
|
|
95
|
+
if %(show_button hidden_button col_id).include? key.to_s
|
|
96
|
+
str << "#{Axlsx.camel(key, false)}='#{value}' "
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
str
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|