From f51a4ce6a22f0b651eebf6f84a18a913d22013b2 Mon Sep 17 00:00:00 2001
From: Randy Morgan
Date: Mon, 21 Nov 2011 08:59:50 +0900
Subject: patched bug in package test case. upped the version
---
.yardoc/checksums | 76 +++++++++++++--------------
.yardoc/objects/root.dat | Bin 406444 -> 404926 bytes
README.md | 102 +++++++++++++++++++++++++++++++-----
assets/example.rb | 39 ++++++++++++++
doc/Axlsx.html | 4 +-
doc/Axlsx/App.html | 2 +-
doc/Axlsx/Axis.html | 2 +-
doc/Axlsx/Bar3DChart.html | 2 +-
doc/Axlsx/BarSeries.html | 2 +-
doc/Axlsx/Border.html | 2 +-
doc/Axlsx/BorderPr.html | 2 +-
doc/Axlsx/CatAxis.html | 2 +-
doc/Axlsx/Cell.html | 2 +-
doc/Axlsx/CellAlignment.html | 2 +-
doc/Axlsx/CellProtection.html | 2 +-
doc/Axlsx/CellStyle.html | 2 +-
doc/Axlsx/Chart.html | 2 +-
doc/Axlsx/Color.html | 2 +-
doc/Axlsx/ContentType.html | 2 +-
doc/Axlsx/Core.html | 2 +-
doc/Axlsx/DataTypeValidator.html | 2 +-
doc/Axlsx/Default.html | 2 +-
doc/Axlsx/Drawing.html | 2 +-
doc/Axlsx/Fill.html | 2 +-
doc/Axlsx/Font.html | 2 +-
doc/Axlsx/GradientFill.html | 2 +-
doc/Axlsx/GradientStop.html | 2 +-
doc/Axlsx/GraphicFrame.html | 2 +-
doc/Axlsx/Marker.html | 2 +-
doc/Axlsx/NumFmt.html | 2 +-
doc/Axlsx/Override.html | 2 +-
doc/Axlsx/Package.html | 2 +-
doc/Axlsx/PatternFill.html | 2 +-
doc/Axlsx/Pie3DChart.html | 2 +-
doc/Axlsx/PieSeries.html | 2 +-
doc/Axlsx/RegexValidator.html | 2 +-
doc/Axlsx/Relationship.html | 2 +-
doc/Axlsx/Relationships.html | 2 +-
doc/Axlsx/RestrictionValidator.html | 2 +-
doc/Axlsx/Row.html | 2 +-
doc/Axlsx/Scaling.html | 2 +-
doc/Axlsx/Series.html | 2 +-
doc/Axlsx/SimpleTypedList.html | 2 +-
doc/Axlsx/Styles.html | 2 +-
doc/Axlsx/TableStyle.html | 2 +-
doc/Axlsx/TableStyleElement.html | 2 +-
doc/Axlsx/TableStyles.html | 2 +-
doc/Axlsx/Title.html | 2 +-
doc/Axlsx/TwoCellAnchor.html | 2 +-
doc/Axlsx/ValAxis.html | 2 +-
doc/Axlsx/View3D.html | 2 +-
doc/Axlsx/Workbook.html | 2 +-
doc/Axlsx/Worksheet.html | 2 +-
doc/Axlsx/Xf.html | 2 +-
doc/_index.html | 2 +-
doc/file.README.html | 82 +++++++++++++++++++++++------
doc/index.html | 82 +++++++++++++++++++++++------
doc/top-level-namespace.html | 2 +-
lib/axlsx/util/constants.rb | 2 +-
test/tc_package.rb | 14 ++---
60 files changed, 357 insertions(+), 146 deletions(-)
diff --git a/.yardoc/checksums b/.yardoc/checksums
index 2d1250ac..784b549d 100644
--- a/.yardoc/checksums
+++ b/.yardoc/checksums
@@ -1,49 +1,49 @@
-lib/axlsx/stylesheet/table_styles.rb 04b778652c29d612f63e93080d06c3936e48d765
-lib/axlsx/stylesheet/table_style.rb b592135b8b02969a29bd24c28a13282f6af76f30
-lib/axlsx/drawing/pie_3D_chart.rb 9a93a6fcf43122ed41f522f50b9d0d0340be1688
-lib/axlsx/stylesheet/border_pr.rb 09dcb61ec7b0cf49f2da4c4f8ccba8f7e0df7b07
-lib/axlsx/stylesheet/color.rb 4927aaebe27dda42d78bb7baf9a44edc1753c77f
+lib/axlsx/util/constants.rb 3441c292d88c3c1c7ab4c5f15d3ac2a434b3b87b
lib/axlsx/drawing/marker.rb 3507738522c02a3733a01f115d9ef22fae4ea542
-lib/axlsx/util/constants.rb 57d6b6609e064c2b6936b585bf2ebede74ea2396
-lib/axlsx/stylesheet/cell_protection.rb ce494f9add6de0a51407ddd9122fffe95759a48a
-lib/axlsx/stylesheet/cell_style.rb 46c6ff183bce5c6b1ab6228823257d638007b03c
-lib/axlsx/drawing/series.rb 76a9b00ab44c4b9553a017aa25f7f504c2b41484
+lib/axlsx/stylesheet/color.rb 4927aaebe27dda42d78bb7baf9a44edc1753c77f
+lib/axlsx/stylesheet/border_pr.rb 09dcb61ec7b0cf49f2da4c4f8ccba8f7e0df7b07
+lib/axlsx/drawing/pie_3D_chart.rb 9a93a6fcf43122ed41f522f50b9d0d0340be1688
+lib/axlsx/stylesheet/table_style.rb b592135b8b02969a29bd24c28a13282f6af76f30
+lib/axlsx/stylesheet/table_styles.rb 04b778652c29d612f63e93080d06c3936e48d765
lib/axlsx/package.rb eea7499e09e0936eeb8e08d10823f05990722023
-lib/axlsx/stylesheet/cell_alignment.rb f67f6a0bc16bf13669ed7b18714e4de23825ed94
-lib/axlsx/content_type/default.rb 8ec0d9d1e6bf261735739823acd460c271e3f5ed
-lib/axlsx/drawing/title.rb 7069b1c32bd209addd9808be005dae176819b8e0
+lib/axlsx/drawing/series.rb 76a9b00ab44c4b9553a017aa25f7f504c2b41484
+lib/axlsx/stylesheet/cell_style.rb 46c6ff183bce5c6b1ab6228823257d638007b03c
+lib/axlsx/stylesheet/cell_protection.rb ce494f9add6de0a51407ddd9122fffe95759a48a
lib/axlsx/drawing/axis.rb 5316065040d08d4f15e5da2751a2ee90185dad61
-lib/axlsx/stylesheet/table_style_element.rb bee66d743e3113fb14adc7ebdecbeb606bfb49fc
-lib/axlsx/content_type/content_type.rb 6c576e1618f99f7163fffa6b6e89e964653dcb5f
-lib/axlsx/stylesheet/num_fmt.rb dc830c6540465afa824881efa2f1ce4070957c47
-lib/axlsx/rels/relationships.rb 9c741e180796259bb378a789fd484fa1d8f04425
+lib/axlsx/drawing/title.rb 7069b1c32bd209addd9808be005dae176819b8e0
+lib/axlsx/content_type/default.rb 8ec0d9d1e6bf261735739823acd460c271e3f5ed
+lib/axlsx/stylesheet/cell_alignment.rb f67f6a0bc16bf13669ed7b18714e4de23825ed94
lib/axlsx.rb 7d8c589a0bdc16acf8774ae1b77d5177b030a80c
-lib/axlsx/drawing/graphic_frame.rb 5ff7476b8fa3e2101fde200d1c65844084fb42f7
-lib/axlsx/content_type/override.rb 72245683bca868f181d709a515f9152485653229
-lib/axlsx/drawing/pie_series.rb 76c67a0227e913fb14eb70d756323974718e204a
+lib/axlsx/rels/relationships.rb 9c741e180796259bb378a789fd484fa1d8f04425
+lib/axlsx/stylesheet/num_fmt.rb dc830c6540465afa824881efa2f1ce4070957c47
+lib/axlsx/content_type/content_type.rb 6c576e1618f99f7163fffa6b6e89e964653dcb5f
+lib/axlsx/stylesheet/table_style_element.rb bee66d743e3113fb14adc7ebdecbeb606bfb49fc
lib/axlsx/drawing/bar_series.rb a8a1648a1bec8d3d4bc07786f2c55c0c0d658e15
-lib/axlsx/stylesheet/gradient_fill.rb 5fd260ec2b94ab75a970159035528548a9d21cd6
-lib/axlsx/workbook/worksheet/row.rb f866a98341ce4e604908e42d00f2af09e58c75d2
-lib/axlsx/util/simple_typed_list.rb 2ae647d5305acd9181c3303d5638db46d190b786
-lib/axlsx/workbook/workbook.rb ec98ed826e6c3ca9c6e3303dbfbe00c0b5fb9aee
-lib/axlsx/stylesheet/fill.rb 35966285f5d759d63451005ceae3a5ae5ba2ceca
-lib/axlsx/drawing/view_3D.rb aca4d987f0c2cd5d0a653c96ac2bc1df9392583a
+lib/axlsx/drawing/pie_series.rb 76c67a0227e913fb14eb70d756323974718e204a
+lib/axlsx/content_type/override.rb 72245683bca868f181d709a515f9152485653229
+lib/axlsx/drawing/graphic_frame.rb 5ff7476b8fa3e2101fde200d1c65844084fb42f7
lib/axlsx/stylesheet/xf.rb e3d6e2e4c3b0b33c91de4c3db16c73aca3db4473
-lib/axlsx/drawing/two_cell_anchor.rb cc320f580ff9c639daa670f7ba1a1648bf26c157
-lib/axlsx/stylesheet/styles.rb 3679a8fe86270bdef96f02bcf76f2eac27b1c2ef
-lib/axlsx/drawing/val_axis.rb 710e67120c1262ef4cbbb56b632a568731df3215
-lib/axlsx/drawing/cat_axis.rb bf9eae6efae39b003a98b44cc437e6e9b4c51985
-lib/axlsx/stylesheet/font.rb 8b002d5fcba2fb0979858517f5254aadf96c7e58
-lib/axlsx/util/validators.rb 2320eee50ceee29cc0dbab95721a6c633dc660e1
+lib/axlsx/drawing/view_3D.rb aca4d987f0c2cd5d0a653c96ac2bc1df9392583a
+lib/axlsx/stylesheet/fill.rb 35966285f5d759d63451005ceae3a5ae5ba2ceca
+lib/axlsx/workbook/workbook.rb ec98ed826e6c3ca9c6e3303dbfbe00c0b5fb9aee
+lib/axlsx/util/simple_typed_list.rb 2ae647d5305acd9181c3303d5638db46d190b786
+lib/axlsx/workbook/worksheet/row.rb f866a98341ce4e604908e42d00f2af09e58c75d2
+lib/axlsx/stylesheet/gradient_fill.rb 5fd260ec2b94ab75a970159035528548a9d21cd6
lib/axlsx/doc_props/app.rb 52f01e985a33253987177798d4e79ed208649b30
-lib/axlsx/workbook/worksheet/worksheet.rb 1af6b7e4a54b41e770709c26ad7100ed516448b8
-lib/axlsx/workbook/worksheet/cell.rb 939623ffc2065e9ec26bc56d9e289d9137fe57d3
-lib/axlsx/stylesheet/border.rb 517bfcb43380919ce7abef494d5d3e50911b7c19
-lib/axlsx/rels/relationship.rb a160c998acf7fd0ab8195ea6162b1eb2eab4963c
-lib/axlsx/drawing/drawing.rb cdb97d463eb539baf96a105493aca17d7ddf57e5
+lib/axlsx/util/validators.rb 2320eee50ceee29cc0dbab95721a6c633dc660e1
+lib/axlsx/stylesheet/font.rb 8b002d5fcba2fb0979858517f5254aadf96c7e58
+lib/axlsx/drawing/cat_axis.rb bf9eae6efae39b003a98b44cc437e6e9b4c51985
+lib/axlsx/drawing/val_axis.rb 710e67120c1262ef4cbbb56b632a568731df3215
+lib/axlsx/stylesheet/styles.rb 3679a8fe86270bdef96f02bcf76f2eac27b1c2ef
+lib/axlsx/drawing/two_cell_anchor.rb cc320f580ff9c639daa670f7ba1a1648bf26c157
lib/axlsx/drawing/chart.rb 41dce85f81b7f5d5df3493597c1560d0f0c50c62
-lib/axlsx/stylesheet/gradient_stop.rb de34e289aeccb4abd9a3b7e60e816a0b12ffacff
+lib/axlsx/drawing/drawing.rb cdb97d463eb539baf96a105493aca17d7ddf57e5
+lib/axlsx/rels/relationship.rb a160c998acf7fd0ab8195ea6162b1eb2eab4963c
+lib/axlsx/stylesheet/border.rb 517bfcb43380919ce7abef494d5d3e50911b7c19
+lib/axlsx/workbook/worksheet/cell.rb 939623ffc2065e9ec26bc56d9e289d9137fe57d3
+lib/axlsx/workbook/worksheet/worksheet.rb 1af6b7e4a54b41e770709c26ad7100ed516448b8
lib/axlsx/doc_props/core.rb 90ebc8086f6606af02275c27068c359a5647faf0
-lib/axlsx/drawing/bar_3D_chart.rb 68a516574b727bf9fc7e030d13060eaf7e36221e
+lib/axlsx/stylesheet/gradient_stop.rb de34e289aeccb4abd9a3b7e60e816a0b12ffacff
lib/axlsx/drawing/scaling.rb d3b59eed1897dc2b07bb41b2245c6e4b3e274d7e
+lib/axlsx/drawing/bar_3D_chart.rb 68a516574b727bf9fc7e030d13060eaf7e36221e
lib/axlsx/stylesheet/pattern_fill.rb 817cf55beb3db160b2b56edb6c94de1ecf1ecee7
diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat
index 45773126..5746b14f 100644
Binary files a/.yardoc/objects/root.dat and b/.yardoc/objects/root.dat differ
diff --git a/README.md b/README.md
index b29499fd..45656275 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,11 @@ Feature List
**4. Automatic type support: Axlsx will automatically determine the type of data you are generating. In this release Float, Integer, String and Time types are automatically identified and serialized to your spreadsheet.
+**5. Automatic column widths: Axlsx will automatically determine the appropriate width for your columns based on the content in the worksheet.
+
+**6. Support for both 1904 and 1900 epocs configurable in the workbook.
+
+
Installing
----------
@@ -35,19 +40,87 @@ To install Axlsx, use the following command:
Usage
-----
+Simple Workbook
-Generating a workbook with styles and a chart:
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ end
+ package.serialize("example1.xlsx")
+ end
+
+Generating A Bar Chart
- p = Axlsx::Package.new do |package|
- package.workbook.add_worksheet do |sheet|
- sheet.add_row ["First", "Second", "Third"], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
- chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
- end
- end
- package.serialize("example1.xlsx")
- end
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example1.xlsx")
+ end
+
+Generating A Pie Chart
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Pie3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 2: Pie Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example3.xlsx")
+ end
+
+Using Custom Styles
+
+ p = Axlsx::Package.new do |package|
+ style_options = { :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+ header_style = package.workbook.styles.add_style style_options
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["Text Autowidth", "Second", "Third"], :style => header_style
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ end
+ package.serialize("example3.xlsx")
+ end
+
+Cell Specifc Styles
+
+ p = Axlsx::Package.new do |package|
+
+ black_cell_spec = { :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+ blue_cell_spec = { :bg_color => "FF0000FF", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+
+ black_cell = package.workbook.styles.add_style black_cell_spec
+ blue_cell = package.workbook.styles.add_style blue_cell_spec
+
+ # date1904 support. uncomment the line below if you are working on a mac.
+ # package.workbook.date1904 = true
+
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["Text Autowidth", "Second", "Third"], :style => [black_cell, blue_cell, black_cell]
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ end
+ package.serialize("example3.xlsx")
+ end
+
+Number and Date formatting
+ p = Axlsx::Package.new do |package|
+ date = package.workbook.styles.add_style :format_code=>"yyyy-mm-dd", :border => Axlsx::STYLE_THIN_BORDER
+ padded = package.workbook.styles.add_style :format_code=>"00#", :border => Axlsx::STYLE_THIN_BORDER
+ percent = package.workbook.styles.add_style :format_code=>"0%", :border => Axlsx::STYLE_THIN_BORDER
+
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row
+ sheet.add_row ["Custom Formatted Date", "Percent Formatted Float", "Padded Numbers"], :style => Axlsx::STYLE_THIN_BORDER
+ sheet.add_row [Time.now, 0.2, 32], :style => [date, percent, padded]
+ end
+ package.serialize("example5.xlsx")
+ end
### Documentation
This gem is 100% documented with YARD, an exceptional documentation library. To see documentation for this, and all the gems installed on your system use:
@@ -61,8 +134,11 @@ This gem has 100% test coverage. To execute tests for this gem, simply run rake
Changelog
---------
-- **October.10.11**: 0.1.0 release
-
+- **October.20.11**: 0.1.0 release
+- **October.21.11**: 1.0.3 release
+ - Updated documentation
+ - altered package to accept a filename string for serialization instead of a File object.
+ - Updated specs to conform
Copyright
---------
diff --git a/assets/example.rb b/assets/example.rb
index 4d35e3ed..aaaf3970 100644
--- a/assets/example.rb
+++ b/assets/example.rb
@@ -12,6 +12,45 @@ p = Axlsx::Package.new do |package|
package.serialize("example1.xlsx")
end
+p = Axlsx::Package.new do |package|
+ header_style = package.workbook.styles.add_style :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => {:horizontal => :center }
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"], :style => header_style
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ sheet.add_chart(Axlsx::Pie3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 2: Pie Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example3.xlsx")
+end
+
+p = Axlsx::Package.new do |package|
+ black_cell_spec = { :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+ blue_cell_spec = { :bg_color => "FF0000FF", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+
+ black_cell = package.workbook.styles.add_style black_cell_spec
+ blue_cell = package.workbook.styles.add_style blue_cell_spec
+
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["Text Autowidth", "Second", "Third"], :style => [black_cell, blue_cell, black_cell]
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ end
+ package.serialize("example4.xlsx")
+end
+# example 5
+ p = Axlsx::Package.new do |package|
+ date = package.workbook.styles.add_style :format_code=>"yyyy-mm-dd", :border => Axlsx::STYLE_THIN_BORDER
+ padded = package.workbook.styles.add_style :format_code=>"00#", :border => Axlsx::STYLE_THIN_BORDER
+ percent = package.workbook.styles.add_style :format_code=>"0%", :border => Axlsx::STYLE_THIN_BORDER
+ package.workbook.date1904 = true
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row
+ sheet.add_row ["Custom Formatted Date", "Percent Formatted Float", "Padded Numbers"], :style => Axlsx::STYLE_THIN_BORDER
+ sheet.add_row [Time.now, 0.2, 32], :style => [date, percent, padded]
+ end
+ package.serialize("example5.xlsx")
+ end
+
p = Axlsx::Package.new
wb = p.workbook
diff --git a/doc/Axlsx.html b/doc/Axlsx.html
index 71a41a34..db3bf15b 100644
--- a/doc/Axlsx.html
+++ b/doc/Axlsx.html
@@ -122,7 +122,7 @@ version
- "1.0.1"
+
"1.0.3"
ENCODING =
@@ -2434,7 +2434,7 @@ The value validated
diff --git a/doc/Axlsx/App.html b/doc/Axlsx/App.html
index b903dd74..1cf634dd 100644
--- a/doc/Axlsx/App.html
+++ b/doc/Axlsx/App.html
@@ -2631,7 +2631,7 @@ The document as a string
diff --git a/doc/Axlsx/Axis.html b/doc/Axlsx/Axis.html
index 77f8e066..9dece081 100644
--- a/doc/Axlsx/Axis.html
+++ b/doc/Axlsx/Axis.html
@@ -1038,7 +1038,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Bar3DChart.html b/doc/Axlsx/Bar3DChart.html
index 0c68f3b0..68333aa2 100644
--- a/doc/Axlsx/Bar3DChart.html
+++ b/doc/Axlsx/Bar3DChart.html
@@ -1144,7 +1144,7 @@ Serializes the bar chart
diff --git a/doc/Axlsx/BarSeries.html b/doc/Axlsx/BarSeries.html
index e6580e5c..04021bf2 100644
--- a/doc/Axlsx/BarSeries.html
+++ b/doc/Axlsx/BarSeries.html
@@ -753,7 +753,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Border.html b/doc/Axlsx/Border.html
index 5345c2b9..21845aaa 100644
--- a/doc/Axlsx/Border.html
+++ b/doc/Axlsx/Border.html
@@ -766,7 +766,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/BorderPr.html b/doc/Axlsx/BorderPr.html
index 814602cd..12bcf276 100644
--- a/doc/Axlsx/BorderPr.html
+++ b/doc/Axlsx/BorderPr.html
@@ -700,7 +700,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/CatAxis.html b/doc/Axlsx/CatAxis.html
index e2102834..c1a3907b 100644
--- a/doc/Axlsx/CatAxis.html
+++ b/doc/Axlsx/CatAxis.html
@@ -757,7 +757,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Cell.html b/doc/Axlsx/Cell.html
index 4869d7a1..e659168b 100644
--- a/doc/Axlsx/Cell.html
+++ b/doc/Axlsx/Cell.html
@@ -1614,7 +1614,7 @@ xml text for the cell
diff --git a/doc/Axlsx/CellAlignment.html b/doc/Axlsx/CellAlignment.html
index 94c7e8ed..a1b9a56c 100644
--- a/doc/Axlsx/CellAlignment.html
+++ b/doc/Axlsx/CellAlignment.html
@@ -1238,7 +1238,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/CellProtection.html b/doc/Axlsx/CellProtection.html
index acbcd9b3..53d01dc9 100644
--- a/doc/Axlsx/CellProtection.html
+++ b/doc/Axlsx/CellProtection.html
@@ -556,7 +556,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/CellStyle.html b/doc/Axlsx/CellStyle.html
index 93e7e34f..a3bb37aa 100644
--- a/doc/Axlsx/CellStyle.html
+++ b/doc/Axlsx/CellStyle.html
@@ -940,7 +940,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Chart.html b/doc/Axlsx/Chart.html
index 9ff73152..d7e1e5c1 100644
--- a/doc/Axlsx/Chart.html
+++ b/doc/Axlsx/Chart.html
@@ -1360,7 +1360,7 @@ Chart Serialization serializes the chart
diff --git a/doc/Axlsx/Color.html b/doc/Axlsx/Color.html
index 6e8fbb79..ea258b5c 100644
--- a/doc/Axlsx/Color.html
+++ b/doc/Axlsx/Color.html
@@ -656,7 +656,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/ContentType.html b/doc/Axlsx/ContentType.html
index 3c77aaaf..c6df769d 100644
--- a/doc/Axlsx/ContentType.html
+++ b/doc/Axlsx/ContentType.html
@@ -331,7 +331,7 @@ The document as a string.
diff --git a/doc/Axlsx/Core.html b/doc/Axlsx/Core.html
index 8ddaacec..d6cbb70f 100644
--- a/doc/Axlsx/Core.html
+++ b/doc/Axlsx/Core.html
@@ -456,7 +456,7 @@ time when this method is called.
diff --git a/doc/Axlsx/DataTypeValidator.html b/doc/Axlsx/DataTypeValidator.html
index cf8d6c95..a52b5754 100644
--- a/doc/Axlsx/DataTypeValidator.html
+++ b/doc/Axlsx/DataTypeValidator.html
@@ -315,7 +315,7 @@ types or the block passed returns false
diff --git a/doc/Axlsx/Default.html b/doc/Axlsx/Default.html
index 8b143c4a..e26a4173 100644
--- a/doc/Axlsx/Default.html
+++ b/doc/Axlsx/Default.html
@@ -566,7 +566,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Drawing.html b/doc/Axlsx/Drawing.html
index 227f8594..3ebad077 100644
--- a/doc/Axlsx/Drawing.html
+++ b/doc/Axlsx/Drawing.html
@@ -1145,7 +1145,7 @@ Serializes the drawing
diff --git a/doc/Axlsx/Fill.html b/doc/Axlsx/Fill.html
index ef8ed32d..e4d54840 100644
--- a/doc/Axlsx/Fill.html
+++ b/doc/Axlsx/Fill.html
@@ -451,7 +451,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Font.html b/doc/Axlsx/Font.html
index 5c332f3a..261cb513 100644
--- a/doc/Axlsx/Font.html
+++ b/doc/Axlsx/Font.html
@@ -1545,7 +1545,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/GradientFill.html b/doc/Axlsx/GradientFill.html
index e6477c43..4c1d6f34 100644
--- a/doc/Axlsx/GradientFill.html
+++ b/doc/Axlsx/GradientFill.html
@@ -1017,7 +1017,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/GradientStop.html b/doc/Axlsx/GradientStop.html
index c733c4c3..07d32399 100644
--- a/doc/Axlsx/GradientStop.html
+++ b/doc/Axlsx/GradientStop.html
@@ -517,7 +517,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/GraphicFrame.html b/doc/Axlsx/GraphicFrame.html
index d5ef9048..1796d22c 100644
--- a/doc/Axlsx/GraphicFrame.html
+++ b/doc/Axlsx/GraphicFrame.html
@@ -637,7 +637,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Marker.html b/doc/Axlsx/Marker.html
index 0b2298fe..4d207dcf 100644
--- a/doc/Axlsx/Marker.html
+++ b/doc/Axlsx/Marker.html
@@ -848,7 +848,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/NumFmt.html b/doc/Axlsx/NumFmt.html
index 526b0c21..2fa42536 100644
--- a/doc/Axlsx/NumFmt.html
+++ b/doc/Axlsx/NumFmt.html
@@ -553,7 +553,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Override.html b/doc/Axlsx/Override.html
index aaedfd6a..1611c3b0 100644
--- a/doc/Axlsx/Override.html
+++ b/doc/Axlsx/Override.html
@@ -559,7 +559,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Package.html b/doc/Axlsx/Package.html
index 6d6cc4b1..bccc0255 100644
--- a/doc/Axlsx/Package.html
+++ b/doc/Axlsx/Package.html
@@ -1284,7 +1284,7 @@ An array of all validation errors encountered.
diff --git a/doc/Axlsx/PatternFill.html b/doc/Axlsx/PatternFill.html
index 668fb913..0a45f7a0 100644
--- a/doc/Axlsx/PatternFill.html
+++ b/doc/Axlsx/PatternFill.html
@@ -672,7 +672,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Pie3DChart.html b/doc/Axlsx/Pie3DChart.html
index 707e123b..710cf7e4 100644
--- a/doc/Axlsx/Pie3DChart.html
+++ b/doc/Axlsx/Pie3DChart.html
@@ -430,7 +430,7 @@ Serializes the pie chart
diff --git a/doc/Axlsx/PieSeries.html b/doc/Axlsx/PieSeries.html
index 32ae079d..24164fd5 100644
--- a/doc/Axlsx/PieSeries.html
+++ b/doc/Axlsx/PieSeries.html
@@ -753,7 +753,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/RegexValidator.html b/doc/Axlsx/RegexValidator.html
index 9defbde5..5770cc34 100644
--- a/doc/Axlsx/RegexValidator.html
+++ b/doc/Axlsx/RegexValidator.html
@@ -259,7 +259,7 @@ The value to validate.
diff --git a/doc/Axlsx/Relationship.html b/doc/Axlsx/Relationship.html
index e29e9fe2..56a4a057 100644
--- a/doc/Axlsx/Relationship.html
+++ b/doc/Axlsx/Relationship.html
@@ -545,7 +545,7 @@ the reference id of the object.
diff --git a/doc/Axlsx/Relationships.html b/doc/Axlsx/Relationships.html
index 44302150..7a6b8f83 100644
--- a/doc/Axlsx/Relationships.html
+++ b/doc/Axlsx/Relationships.html
@@ -334,7 +334,7 @@ Serializes the relationships document.
diff --git a/doc/Axlsx/RestrictionValidator.html b/doc/Axlsx/RestrictionValidator.html
index 5a2aca79..2333e0e7 100644
--- a/doc/Axlsx/RestrictionValidator.html
+++ b/doc/Axlsx/RestrictionValidator.html
@@ -291,7 +291,7 @@ Raised if the value provided is not in the list of choices.
diff --git a/doc/Axlsx/Row.html b/doc/Axlsx/Row.html
index d20ce5e7..a0492bf2 100644
--- a/doc/Axlsx/Row.html
+++ b/doc/Axlsx/Row.html
@@ -762,7 +762,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Scaling.html b/doc/Axlsx/Scaling.html
index 063bfb34..731f0beb 100644
--- a/doc/Axlsx/Scaling.html
+++ b/doc/Axlsx/Scaling.html
@@ -731,7 +731,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Series.html b/doc/Axlsx/Series.html
index 0a907284..916bea45 100644
--- a/doc/Axlsx/Series.html
+++ b/doc/Axlsx/Series.html
@@ -741,7 +741,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/SimpleTypedList.html b/doc/Axlsx/SimpleTypedList.html
index f112ef88..e5937d25 100644
--- a/doc/Axlsx/SimpleTypedList.html
+++ b/doc/Axlsx/SimpleTypedList.html
@@ -1608,7 +1608,7 @@ Unlock the list
diff --git a/doc/Axlsx/Styles.html b/doc/Axlsx/Styles.html
index bed1e3ac..068b6d46 100644
--- a/doc/Axlsx/Styles.html
+++ b/doc/Axlsx/Styles.html
@@ -1745,7 +1745,7 @@ Serializes the styles document
diff --git a/doc/Axlsx/TableStyle.html b/doc/Axlsx/TableStyle.html
index 481d4746..0f756e06 100644
--- a/doc/Axlsx/TableStyle.html
+++ b/doc/Axlsx/TableStyle.html
@@ -701,7 +701,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/TableStyleElement.html b/doc/Axlsx/TableStyleElement.html
index 5ae59057..aaf72d82 100644
--- a/doc/Axlsx/TableStyleElement.html
+++ b/doc/Axlsx/TableStyleElement.html
@@ -668,7 +668,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/TableStyles.html b/doc/Axlsx/TableStyles.html
index 1b368e7c..5526e203 100644
--- a/doc/Axlsx/TableStyles.html
+++ b/doc/Axlsx/TableStyles.html
@@ -590,7 +590,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Title.html b/doc/Axlsx/Title.html
index b6384c54..ab6c5238 100644
--- a/doc/Axlsx/Title.html
+++ b/doc/Axlsx/Title.html
@@ -612,7 +612,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/TwoCellAnchor.html b/doc/Axlsx/TwoCellAnchor.html
index 6f307a26..03cfeebf 100644
--- a/doc/Axlsx/TwoCellAnchor.html
+++ b/doc/Axlsx/TwoCellAnchor.html
@@ -1106,7 +1106,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/ValAxis.html b/doc/Axlsx/ValAxis.html
index 4885e3ba..45b9bea9 100644
--- a/doc/Axlsx/ValAxis.html
+++ b/doc/Axlsx/ValAxis.html
@@ -530,7 +530,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/View3D.html b/doc/Axlsx/View3D.html
index 376b5223..6bc8857b 100644
--- a/doc/Axlsx/View3D.html
+++ b/doc/Axlsx/View3D.html
@@ -962,7 +962,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/Axlsx/Workbook.html b/doc/Axlsx/Workbook.html
index 12ffbc60..0598bb3d 100644
--- a/doc/Axlsx/Workbook.html
+++ b/doc/Axlsx/Workbook.html
@@ -1338,7 +1338,7 @@ Serializes the workbook document
diff --git a/doc/Axlsx/Worksheet.html b/doc/Axlsx/Worksheet.html
index 7050472c..0a8da325 100644
--- a/doc/Axlsx/Worksheet.html
+++ b/doc/Axlsx/Worksheet.html
@@ -1855,7 +1855,7 @@ of Cell objects
diff --git a/doc/Axlsx/Xf.html b/doc/Axlsx/Xf.html
index 0eb425be..ef2abfd9 100644
--- a/doc/Axlsx/Xf.html
+++ b/doc/Axlsx/Xf.html
@@ -1672,7 +1672,7 @@ The document builder instance this objects xml will be added to.
diff --git a/doc/_index.html b/doc/_index.html
index 434f86a5..aa1ce964 100644
--- a/doc/_index.html
+++ b/doc/_index.html
@@ -566,7 +566,7 @@
diff --git a/doc/file.README.html b/doc/file.README.html
index 73017f95..ff39e7b5 100644
--- a/doc/file.README.html
+++ b/doc/file.README.html
@@ -61,7 +61,7 @@
Author: Randy Morgan
Copyright: 2011
License: MIT License
-Latest Version: 1.0.0
+Latest Version: 1.0.2
Release Date: November 20th 2011
Synopsis
@@ -79,6 +79,10 @@ It enables the you to generate 100% valid xlsx files that include customised sty
**4. Automatic type support: Axlsx will automatically determine the type of data you are generating. In this release Float, Integer, String and Time types are automatically identified and serialized to your spreadsheet.
+**5. Automatic column widths: Axlsx will automatically determine the appropriate width for your columns based on the content in the worksheet.
+
+**6. Support for both 1904 and 1900 epocs configurable in the workbook.
+
Installing
To install Axlsx, use the following command:
@@ -88,20 +92,57 @@ It enables the you to generate 100% valid xlsx files that include customised sty
Usage
-Generating a workbook with styles and a chart:
- p = Axlsx::Package.new do |package|
-
-package.workbook.add_worksheet do |sheet|
- sheet.add_row ["First", "Second", "Third"], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
- chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
- end
-end
-package.serialize("example1.xlsx")
+Simple Workbook
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ end
+ package.serialize("example1.xlsx")
+ end
- end
+Generating A Bar Chart
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example1.xlsx")
+ end
+
+
+Generating A Pie Chart
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Pie3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 2: Pie Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example3.xlsx")
+ end
+
+
+Using Custom Styles
+
+ p = Axlsx::Package.new do |package|
+ style_options = { :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+ = package.workbook.styles.add_style style_options
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["Text Autowidth", "Second", "Third"], :style =>
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ end
+ package.serialize("example3.xlsx")
+ end
+
Documentation
@@ -116,18 +157,27 @@ It enables the you to generate 100% valid xlsx files that include customised sty
Changelog
-- October.10.11: 0.1.0 release
+- October.20.11: 0.1.0 release
+- October.21.11: 1.0.3 release
+
+
+- Updated documentation
+- altered package to accept a filename string for serialization instead of a File object.
+- Updated specs to conform
+Copyright
+
+
-Copyright
+
Axlsx © 2011 by Randy Morgan. Axlsx is
licensed under the MIT license. Please see the LICENSE document for more information.
diff --git a/doc/index.html b/doc/index.html
index 9d556159..ff39e7b5 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -61,7 +61,7 @@
Author: Randy Morgan
Copyright: 2011
License: MIT License
-Latest Version: 1.0.0
+Latest Version: 1.0.2
Release Date: November 20th 2011
Synopsis
@@ -79,6 +79,10 @@ It enables the you to generate 100% valid xlsx files that include customised sty
**4. Automatic type support: Axlsx will automatically determine the type of data you are generating. In this release Float, Integer, String and Time types are automatically identified and serialized to your spreadsheet.
+**5. Automatic column widths: Axlsx will automatically determine the appropriate width for your columns based on the content in the worksheet.
+
+**6. Support for both 1904 and 1900 epocs configurable in the workbook.
+
Installing
To install Axlsx, use the following command:
@@ -88,20 +92,57 @@ It enables the you to generate 100% valid xlsx files that include customised sty
Usage
-Generating a workbook with styles and a chart:
- p = Axlsx::Package.new do |package|
-
-package.workbook.add_worksheet do |sheet|
- sheet.add_row ["First", "Second", "Third"], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
- sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
- chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
- end
-end
-package.serialize("example1.xlsx")
+Simple Workbook
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ end
+ package.serialize("example1.xlsx")
+ end
- end
+Generating A Bar Chart
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Bar3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 1: Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example1.xlsx")
+ end
+
+
+Generating A Pie Chart
+
+ p = Axlsx::Package.new do |package|
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["First", "Second", "Third"]
+ sheet.add_row [1, 2, 3]
+ sheet.add_chart(Axlsx::Pie3DChart, :start_at => [0,2], :end_at => [5, 15], :title=>"example 2: Pie Chart") do |chart|
+ chart.add_series :data=>sheet.rows.last.cells, :labels=> sheet.rows.first.cells
+ end
+ end
+ package.serialize("example3.xlsx")
+ end
+
+
+Using Custom Styles
+
+ p = Axlsx::Package.new do |package|
+ style_options = { :bg_color => "FF000000", :fg_color => "FFFFFFFF", :sz=>14, :alignment => { :horizontal=> :center } }
+ = package.workbook.styles.add_style style_options
+ package.workbook.add_worksheet do |sheet|
+ sheet.add_row ["Text Autowidth", "Second", "Third"], :style =>
+ sheet.add_row [1, 2, 3], :style => Axlsx::STYLE_THIN_BORDER
+ end
+ package.serialize("example3.xlsx")
+ end
+
Documentation
@@ -116,18 +157,27 @@ It enables the you to generate 100% valid xlsx files that include customised sty
Changelog
-- October.10.11: 0.1.0 release
+- October.20.11: 0.1.0 release
+- October.21.11: 1.0.3 release
+
+
+- Updated documentation
+- altered package to accept a filename string for serialization instead of a File object.
+- Updated specs to conform
+Copyright
+
+
-Copyright
+
Axlsx © 2011 by Randy Morgan. Axlsx is
licensed under the MIT license. Please see the LICENSE document for more information.
diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html
index 555cf11d..0a92e23e 100644
--- a/doc/top-level-namespace.html
+++ b/doc/top-level-namespace.html
@@ -94,7 +94,7 @@
diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb
index 463e9baf..a9f4b9f0 100644
--- a/lib/axlsx/util/constants.rb
+++ b/lib/axlsx/util/constants.rb
@@ -1,7 +1,7 @@
module Axlsx
# version
- VERSION="1.0.2"
+ VERSION="1.0.3"
# XML Encoding
ENCODING = "UTF-8"
diff --git a/test/tc_package.rb b/test/tc_package.rb
index 672c3a81..32aabe9d 100644
--- a/test/tc_package.rb
+++ b/test/tc_package.rb
@@ -19,19 +19,15 @@ class TestPackage < Test::Unit::TestCase
def test_serialization
fname = 'test_serialization.xlsx'
assert_nothing_raised do
- if File.writable? fname
- f = File.open(fname, 'w')
- z= @package.serialize(f)
-
- zf = Zip::ZipFile.open(f.path)
+ if File.writable?(fname)
+ z= @package.serialize(fname)
+ zf = Zip::ZipFile.open(fname)
@package.send(:parts).each{ |part| zf.get_entry(part[:entry]) }
- File.delete(f.path)
-
+ File.delete(fname)
else
puts "Skipping write to disk as write permission is not granted to this user"
end
- end
-
+ end
end
def test_validation
--
cgit v1.2.3