axlsx 1.0.16 → 1.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +38 -12
- data/examples/example.rb +18 -1
- data/lib/axlsx.rb +14 -8
- data/lib/axlsx/content_type/content_type.rb +1 -0
- data/lib/axlsx/content_type/default.rb +1 -0
- data/lib/axlsx/content_type/override.rb +1 -0
- data/lib/axlsx/doc_props/app.rb +1 -1
- data/lib/axlsx/doc_props/core.rb +1 -0
- data/lib/axlsx/drawing/axis.rb +1 -0
- data/lib/axlsx/drawing/bar_3D_chart.rb +1 -0
- data/lib/axlsx/drawing/bar_series.rb +1 -0
- data/lib/axlsx/drawing/cat_axis.rb +1 -0
- data/lib/axlsx/drawing/cat_axis_data.rb +1 -0
- data/lib/axlsx/drawing/chart.rb +1 -1
- data/lib/axlsx/drawing/drawing.rb +1 -0
- data/lib/axlsx/drawing/graphic_frame.rb +1 -0
- data/lib/axlsx/drawing/hyperlink.rb +1 -1
- data/lib/axlsx/drawing/line_3D_chart.rb +1 -0
- data/lib/axlsx/drawing/line_series.rb +1 -0
- data/lib/axlsx/drawing/marker.rb +1 -0
- data/lib/axlsx/drawing/one_cell_anchor.rb +1 -0
- data/lib/axlsx/drawing/pic.rb +1 -1
- data/lib/axlsx/drawing/picture_locking.rb +1 -0
- data/lib/axlsx/drawing/pie_3D_chart.rb +1 -0
- data/lib/axlsx/drawing/pie_series.rb +1 -0
- data/lib/axlsx/drawing/scaling.rb +1 -0
- data/lib/axlsx/drawing/ser_axis.rb +1 -0
- data/lib/axlsx/drawing/series.rb +1 -0
- data/lib/axlsx/drawing/series_title.rb +1 -0
- data/lib/axlsx/drawing/title.rb +1 -0
- data/lib/axlsx/drawing/two_cell_anchor.rb +1 -0
- data/lib/axlsx/drawing/val_axis.rb +1 -0
- data/lib/axlsx/drawing/val_axis_data.rb +1 -0
- data/lib/axlsx/drawing/view_3D.rb +1 -0
- data/lib/axlsx/package.rb +63 -15
- data/lib/axlsx/rels/relationship.rb +1 -0
- data/lib/axlsx/rels/relationships.rb +1 -0
- data/lib/axlsx/stylesheet/border.rb +1 -0
- data/lib/axlsx/stylesheet/border_pr.rb +1 -0
- data/lib/axlsx/stylesheet/cell_alignment.rb +1 -0
- data/lib/axlsx/stylesheet/cell_protection.rb +1 -0
- data/lib/axlsx/stylesheet/cell_style.rb +1 -0
- data/lib/axlsx/stylesheet/color.rb +1 -0
- data/lib/axlsx/stylesheet/fill.rb +1 -0
- data/lib/axlsx/stylesheet/font.rb +1 -0
- data/lib/axlsx/stylesheet/gradient_fill.rb +1 -1
- data/lib/axlsx/stylesheet/gradient_stop.rb +1 -1
- data/lib/axlsx/stylesheet/num_fmt.rb +1 -0
- data/lib/axlsx/stylesheet/pattern_fill.rb +1 -0
- data/lib/axlsx/stylesheet/styles.rb +6 -6
- data/lib/axlsx/stylesheet/table_style.rb +1 -0
- data/lib/axlsx/stylesheet/table_style_element.rb +1 -0
- data/lib/axlsx/stylesheet/table_styles.rb +1 -0
- data/lib/axlsx/stylesheet/xf.rb +1 -0
- data/lib/axlsx/util/cbf.rb +1 -0
- data/lib/axlsx/util/constants.rb +7 -0
- data/lib/axlsx/util/ms_off_crypto.rb +1 -1
- data/lib/axlsx/util/parser.rb +1 -0
- data/lib/axlsx/util/simple_typed_list.rb +2 -1
- data/lib/axlsx/util/storage.rb +1 -0
- data/lib/axlsx/util/validators.rb +11 -2
- data/lib/axlsx/version.rb +2 -1
- data/lib/axlsx/workbook/shared_strings_table.rb +71 -0
- data/lib/axlsx/workbook/shared_strings_table.rb~ +69 -0
- data/lib/axlsx/workbook/workbook.rb +25 -3
- data/lib/axlsx/workbook/worksheet/cell.rb +75 -37
- data/lib/axlsx/workbook/worksheet/row.rb +15 -0
- data/lib/axlsx/workbook/worksheet/shared_strings_table.rb~ +0 -0
- data/lib/axlsx/workbook/worksheet/worksheet.rb +35 -3
- data/test/content_type/tc_content_type.rb +2 -0
- data/test/content_type/tc_default.rb +2 -0
- data/test/content_type/tc_override.rb +1 -0
- data/test/tc_package.rb +31 -0
- data/test/workbook/tc_shared_strings_table.rb +39 -0
- data/test/workbook/tc_shared_strings_table.rb~ +8 -0
- data/test/workbook/tc_workbook.rb +8 -0
- data/test/workbook/worksheet/tc_cell.rb +13 -0
- data/test/workbook/worksheet/tc_worksheet.rb +20 -3
- metadata +126 -101
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: UTF-8
|
2
2
|
module Axlsx
|
3
3
|
require 'axlsx/stylesheet/border.rb'
|
4
4
|
require 'axlsx/stylesheet/border_pr.rb'
|
@@ -253,22 +253,22 @@ module Axlsx
|
|
253
253
|
# Creates the default set of styles the exel requires to be valid as well as setting up the
|
254
254
|
# Axlsx::STYLE_THIN_BORDER
|
255
255
|
def load_default_styles
|
256
|
-
@numFmts = SimpleTypedList.new NumFmt
|
256
|
+
@numFmts = SimpleTypedList.new NumFmt, 'numFmts'
|
257
257
|
@numFmts << NumFmt.new(:numFmtId => NUM_FMT_YYYYMMDD, :formatCode=> "yyyy/mm/dd")
|
258
258
|
@numFmts << NumFmt.new(:numFmtId => NUM_FMT_YYYYMMDDHHMMSS, :formatCode=> "yyyy/mm/dd hh:mm:ss")
|
259
259
|
|
260
260
|
@numFmts.lock
|
261
261
|
|
262
|
-
@fonts = SimpleTypedList.new Font
|
262
|
+
@fonts = SimpleTypedList.new Font, 'fonts'
|
263
263
|
@fonts << Font.new(:name => "Arial", :sz => 11, :family=>1)
|
264
264
|
@fonts.lock
|
265
265
|
|
266
|
-
@fills = SimpleTypedList.new Fill
|
266
|
+
@fills = SimpleTypedList.new Fill, 'fills'
|
267
267
|
@fills << Fill.new(Axlsx::PatternFill.new(:patternType=>:none))
|
268
268
|
@fills << Fill.new(Axlsx::PatternFill.new(:patternType=>:gray125))
|
269
269
|
@fills.lock
|
270
270
|
|
271
|
-
@borders = SimpleTypedList.new Border
|
271
|
+
@borders = SimpleTypedList.new Border, 'borders'
|
272
272
|
@borders << Border.new
|
273
273
|
black_border = Border.new
|
274
274
|
[:left, :right, :top, :bottom].each do |item|
|
@@ -281,7 +281,7 @@ module Axlsx
|
|
281
281
|
@cellStyleXfs << Xf.new(:borderId=>0, :numFmtId=>0, :fontId=>0, :fillId=>0)
|
282
282
|
@cellStyleXfs.lock
|
283
283
|
|
284
|
-
@cellStyles = SimpleTypedList.new CellStyle
|
284
|
+
@cellStyles = SimpleTypedList.new CellStyle, 'cellStyles'
|
285
285
|
@cellStyles << CellStyle.new(:name =>"Normal", :builtinId =>0, :xfId=>0)
|
286
286
|
@cellStyles.lock
|
287
287
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Axlsx
|
2
3
|
# TableStyles represents a collection of style definitions for table styles and pivot table styles.
|
3
4
|
# @note Support for custom table styles does not exist in this version. Many of the classes required are defined in preparation for future release. Please do not attempt to add custom table styles.
|
data/lib/axlsx/stylesheet/xf.rb
CHANGED
data/lib/axlsx/util/cbf.rb
CHANGED
data/lib/axlsx/util/constants.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Axlsx
|
2
3
|
|
3
4
|
# XML Encoding
|
@@ -64,6 +65,9 @@ module Axlsx
|
|
64
65
|
# styles rels namespace
|
65
66
|
STYLES_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
|
66
67
|
|
68
|
+
# shared strings namespace
|
69
|
+
SHARED_STRINGS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"
|
70
|
+
|
67
71
|
# drawing rels namespace
|
68
72
|
DRAWING_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
|
69
73
|
|
@@ -138,6 +142,9 @@ module Axlsx
|
|
138
142
|
|
139
143
|
# styles part
|
140
144
|
STYLES_PN = "styles.xml"
|
145
|
+
|
146
|
+
# shared_strings part
|
147
|
+
SHARED_STRINGS_PN = "sharedStrings.xml"
|
141
148
|
|
142
149
|
# app part
|
143
150
|
APP_PN = "docProps/app.xml"
|
data/lib/axlsx/util/parser.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Axlsx
|
2
3
|
# A SimpleTypedList is a type restrictive collection that allows some of the methods from Array and supports basic xml serialization.
|
3
4
|
# @private
|
@@ -153,7 +154,7 @@ module Axlsx
|
|
153
154
|
# @return [String]
|
154
155
|
def to_xml(xml)
|
155
156
|
classname = @allowed_types[0].name.split('::').last
|
156
|
-
el_name = serialize_as || (classname[0,1].downcase + classname[1..-1])
|
157
|
+
el_name = serialize_as || (classname[0,1].downcase + classname[1..-1])
|
157
158
|
xml.send(el_name, :count=>@list.size) {
|
158
159
|
@list.each { |item| item.to_xml(xml) }
|
159
160
|
}
|
data/lib/axlsx/util/storage.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Axlsx
|
2
3
|
# Validate a value against a specific list of allowed values.
|
3
4
|
class RestrictionValidator
|
@@ -52,6 +53,14 @@ module Axlsx
|
|
52
53
|
DataTypeValidator.validate(:unsigned_int, [Fixnum, Integer], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 })
|
53
54
|
end
|
54
55
|
|
56
|
+
# Requires that the value is a Fixnum Integer or Float and is greater or equal to 0
|
57
|
+
# @param [Any] v The value validated
|
58
|
+
# @raise [ArgumentError] raised if the value is not a Fixnum or Integer value greater or equal to 0
|
59
|
+
# @return [Boolean] true if the data is valid
|
60
|
+
def self.validate_unsigned_numeric(v)
|
61
|
+
DataTypeValidator.validate("Invalid column width", [Fixnum, Integer, Float], v, lambda { |arg| arg.respond_to?(:>=) && arg >= 0 })
|
62
|
+
end
|
63
|
+
|
55
64
|
# Requires that the value is a Fixnum or Integer
|
56
65
|
# @param [Any] v The value validated
|
57
66
|
def self.validate_int(v)
|
@@ -116,10 +125,10 @@ module Axlsx
|
|
116
125
|
end
|
117
126
|
|
118
127
|
# Requires that the value is a valid relationship_type
|
119
|
-
# XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R are allowed
|
128
|
+
# XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R, HYPERLINK_R, SHARED_STRINGS_R are allowed
|
120
129
|
# @param [Any] v The value validated
|
121
130
|
def self.validate_relationship_type(v)
|
122
|
-
RestrictionValidator.validate :relationship_type, [XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R, HYPERLINK_R], v
|
131
|
+
RestrictionValidator.validate :relationship_type, [XML_NS_R, TABLE_R, WORKBOOK_R, WORKSHEET_R, APP_R, RELS_R, CORE_R, STYLES_R, CHART_R, DRAWING_R, IMAGE_R, HYPERLINK_R, SHARED_STRINGS_R], v
|
123
132
|
end
|
124
133
|
|
125
134
|
# Requires that the value is a valid table element type
|
data/lib/axlsx/version.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
module Axlsx
|
2
3
|
|
3
4
|
# The version of the gem
|
4
5
|
# When using bunle exec rake and referencing the gem on github or locally
|
5
6
|
# it will use the gemspec, which preloads this constant for the gem's version.
|
6
7
|
# We check to make sure that it has not already been loaded
|
7
|
-
VERSION="1.0.
|
8
|
+
VERSION="1.0.17" unless Axlsx.const_defined? :VERSION
|
8
9
|
|
9
10
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Axlsx
|
3
|
+
|
4
|
+
# The Shared String Table class is responsible for managing and serializing common strings in a workbook.
|
5
|
+
# While the ECMA-376 spec allows for both inline and shared strings it seems that at least some applications like iWorks Numbers
|
6
|
+
# and Google Docs require that the shared string table is populated in order to interoperate properly.
|
7
|
+
# As a developer, you should never need to directly work against this class. Simply set 'use_shared_strings'
|
8
|
+
# on the package or workbook to generate a package that uses the shared strings table instead of inline strings.
|
9
|
+
# @note Serialization performance is affected by using this serialization method so if you do not need interoperability
|
10
|
+
# it is recomended that you use the default inline string method of serialization.
|
11
|
+
class SharedStringsTable
|
12
|
+
|
13
|
+
# The total number of strings in the workbook including duplicates
|
14
|
+
# Empty cells are treated as blank strings
|
15
|
+
# @return [Integer]
|
16
|
+
attr_reader :count
|
17
|
+
|
18
|
+
# The total number of unique strings in the workbook.
|
19
|
+
# @return [Integer]
|
20
|
+
def unique_count
|
21
|
+
@unique_cells.size
|
22
|
+
end
|
23
|
+
|
24
|
+
# An array of unique cells. Multiple attributes of the cell are used in comparison
|
25
|
+
# each of these unique cells is parsed into the shared string table.
|
26
|
+
# @see Cell#sharable
|
27
|
+
attr_reader :unique_cells
|
28
|
+
|
29
|
+
# Creates a new Shared Strings Table agains an array of cells
|
30
|
+
# @param [Array] cells This is an array of all of the cells in the workbook
|
31
|
+
def initialize(cells)
|
32
|
+
cells = cells.flatten.reject { |c| c.type != :string || c.value.start_with?('=') }
|
33
|
+
@count = cells.size
|
34
|
+
@unique_cells = []
|
35
|
+
resolve(cells)
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
# Generate the xml document for the Shared Strings Table
|
40
|
+
# @return [String]
|
41
|
+
def to_xml
|
42
|
+
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
|
43
|
+
xml.sst(:xmlns => Axlsx::XML_NS, :count => count, :uniqueCount => unique_count) {
|
44
|
+
@unique_cells.each do |cell|
|
45
|
+
xml.si { cell.run_xml(xml) }
|
46
|
+
end
|
47
|
+
}
|
48
|
+
end
|
49
|
+
builder.to_xml(:save_with => 0)
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
# Interate over all of the cells in the array.
|
55
|
+
# if our unique cells array does not contain a sharable cell,
|
56
|
+
# add the cell to our unique cells array and set the ssti attribute on the index of this cell in the shared strings table
|
57
|
+
# if a sharable cell already exists in our unique_cells array, set the ssti attribute of the cell and move on.
|
58
|
+
# @return [Array] unique cells
|
59
|
+
def resolve(cells)
|
60
|
+
cells.each do |cell|
|
61
|
+
index = @unique_cells.index { |item| item.shareable(cell) }
|
62
|
+
if index == nil
|
63
|
+
cell.send :ssti=, @unique_cells.size
|
64
|
+
@unique_cells << cell
|
65
|
+
else
|
66
|
+
cell.send :ssti=, index
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# encoding: UTF--8
|
2
|
+
module Axlsx
|
3
|
+
|
4
|
+
# The Shared String Table class is responsible for managing and serializing common strings in a workbook.
|
5
|
+
# While the ECMA-376 spec allows for both inline and shared strings it seems that at least some applications like Numbers (Mac)
|
6
|
+
# and Google Docs require that the shared string table is populated in order to interoperate properly.
|
7
|
+
# As a developer, you should never need to directly work against this class. Simply set 'use_shared_strings'
|
8
|
+
# on the package or workbook to generate a package that uses the shared strings table instead of inline strings.
|
9
|
+
# @note Serialization performance is affected by using this serialization method so if you do not need interoperability
|
10
|
+
# it is recomended that you use the default inline string method of serialization.
|
11
|
+
class SharedStringsTable
|
12
|
+
|
13
|
+
# The total number of strings in the workbook including duplicates
|
14
|
+
# Empty cells are treated as blank strings
|
15
|
+
# @return [Integer]
|
16
|
+
attr_reader :count
|
17
|
+
|
18
|
+
# The total number of unique strings in the workbook.
|
19
|
+
# @return [Integer]
|
20
|
+
def unique_count
|
21
|
+
@unique_cells.size
|
22
|
+
end
|
23
|
+
|
24
|
+
# An array of unique cells. Multiple attributes of the cell are used in comparison
|
25
|
+
# each of these unique cells is parsed into the shared string table.
|
26
|
+
# @see Cell#sharable
|
27
|
+
attr_reader :unique_cells
|
28
|
+
|
29
|
+
# Creates a new Shared Strings Table agains an array of cells
|
30
|
+
# @param [Array] cells This is an array of all of the cells in the workbook
|
31
|
+
def initialize(cells)
|
32
|
+
cells = cells.reject { |c| c.type != :string }
|
33
|
+
@count = cells.size
|
34
|
+
@unique_cells = []
|
35
|
+
resolve cells
|
36
|
+
end
|
37
|
+
|
38
|
+
# Interate over all of the cells in the array.
|
39
|
+
# if our unique cells array does not contain a sharable cell,
|
40
|
+
# add the cell to our unique cells array and set the ssti attribute on the index of this cell in the shared strings table
|
41
|
+
# if a sharable cell already exists in our unique_cells array, set the ssti attribute of the cell and move on.
|
42
|
+
# @return [Array] unique cells
|
43
|
+
def resolve(cells)
|
44
|
+
cells.each do |cell|
|
45
|
+
index = @unique_cells.index { |item| item.sharable(cell) }
|
46
|
+
if index == nil
|
47
|
+
cell.ssti = @unique_cells.size
|
48
|
+
@unique_cells << cell
|
49
|
+
else
|
50
|
+
cell.ssti = index
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Generate the xml document for the Shared Strings Table
|
56
|
+
# @return [String]
|
57
|
+
def to_xml
|
58
|
+
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
|
59
|
+
xml.sst(:xmlns => Axlsx::XML_NS, :count => count, :uniqueCount => unique_count) {
|
60
|
+
@unique_cells.each do |cell|
|
61
|
+
xml.si { xml.t cell.value.to_s }
|
62
|
+
end
|
63
|
+
}
|
64
|
+
end
|
65
|
+
builder.to_xml(:save_with => 0)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
@@ -4,6 +4,7 @@ module Axlsx
|
|
4
4
|
require 'axlsx/workbook/worksheet/cell.rb'
|
5
5
|
require 'axlsx/workbook/worksheet/row.rb'
|
6
6
|
require 'axlsx/workbook/worksheet/worksheet.rb'
|
7
|
+
require 'axlsx/workbook/shared_strings_table.rb'
|
7
8
|
|
8
9
|
# The Workbook class is an xlsx workbook that manages worksheets, charts, drawings and styles.
|
9
10
|
# The following parts of the Office Open XML spreadsheet specification are not implimented in this version.
|
@@ -30,6 +31,19 @@ require 'axlsx/workbook/worksheet/worksheet.rb'
|
|
30
31
|
# *workbookPr is only supported to the extend of date1904
|
31
32
|
class Workbook
|
32
33
|
|
34
|
+
# When true, the Package will be generated with a shared string table. This may be required by some OOXML processors that do not
|
35
|
+
# adhere to the ECMA specification that dictates string may be inline in the sheet.
|
36
|
+
# Using this option will increase the time required to serialize the document as every string in every cell must be analzed and referenced.
|
37
|
+
# @return [Boolean]
|
38
|
+
attr_reader :use_shared_strings
|
39
|
+
|
40
|
+
# @see use_shared_strings
|
41
|
+
def use_shared_strings=(v)
|
42
|
+
Axlsx::validate_boolean(v)
|
43
|
+
@use_shared_strings = v
|
44
|
+
end
|
45
|
+
|
46
|
+
|
33
47
|
# A collection of worksheets associated with this workbook.
|
34
48
|
# @note The recommended way to manage worksheets is add_worksheet
|
35
49
|
# @see Workbook#add_worksheet
|
@@ -82,9 +96,8 @@ require 'axlsx/workbook/worksheet/worksheet.rb'
|
|
82
96
|
#end
|
83
97
|
|
84
98
|
# Creates a new Workbook
|
85
|
-
#
|
86
|
-
# @option options [Boolean] date1904. If this is not specified, we try to determine if the platform is bsd/darwin and set date1904 to true automatically.
|
87
|
-
#
|
99
|
+
# The recomended way to work with workbooks is via Package#workbook
|
100
|
+
# @option options [Boolean] date1904. If this is not specified, we try to determine if the platform is bsd/darwin and set date1904 to true automatically.
|
88
101
|
def initialize(options={})
|
89
102
|
@styles = Styles.new
|
90
103
|
@worksheets = SimpleTypedList.new Worksheet
|
@@ -136,9 +149,18 @@ require 'axlsx/workbook/worksheet/worksheet.rb'
|
|
136
149
|
r << Relationship.new(WORKSHEET_R, WORKSHEET_PN % (r.size+1))
|
137
150
|
end
|
138
151
|
r << Relationship.new(STYLES_R, STYLES_PN)
|
152
|
+
if use_shared_strings
|
153
|
+
r << Relationship.new(SHARED_STRINGS_R, SHARED_STRINGS_PN)
|
154
|
+
end
|
139
155
|
r
|
140
156
|
end
|
141
157
|
|
158
|
+
# generates a shared string object against all cells in all worksheets.
|
159
|
+
# @return [SharedStringTable]
|
160
|
+
def shared_strings
|
161
|
+
SharedStringsTable.new(worksheets.collect { |ws| ws.cells })
|
162
|
+
end
|
163
|
+
|
142
164
|
# returns a range of cells in a worksheet
|
143
165
|
# @param [String] cell_def The excel style reference defining the worksheet and cells. The range must specify the sheet to
|
144
166
|
# retrieve the cells from. e.g. range('Sheet1!A1:B2') will return an array of four cells [A1, A2, B1, B2] while range('Sheet1!A1') will return a single Cell.
|