summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-14 20:38:56 +0900
committerRandy Morgan <[email protected]>2012-02-14 20:38:56 +0900
commit6f8311160efa63239563e89f0c5604b9be4a770f (patch)
tree75c452660512544dca1d99f2c8f22f93c68d2650 /lib
parent501b9f80ec89cbdd01890ba6e66b3fbc849a708a (diff)
downloadcaxlsx-6f8311160efa63239563e89f0c5604b9be4a770f.tar.gz
caxlsx-6f8311160efa63239563e89f0c5604b9be4a770f.zip
couple of additions so that axlsx sheets can be "parsed" by rubyXL.
Not much of a parser if you ask me - as it still chokes on drawing relations and requires a number of optional elements in the sheet. (another excel reverse engineer....) anyway - Im biased, and too lazy to write my own spec-based parser for now. if you *really* need to work with rubyXL - this one is for you.
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 3c310260..9d9317dc 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -268,7 +268,11 @@ module Axlsx
builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
xml.worksheet(:xmlns => XML_NS,
:'xmlns:r' => XML_NS_R) {
+ # another patch for the folks at rubyXL as thier parser depends on this optional element.
xml.dimension :ref=>dimension unless rows.size == 0
+ # this is required by rubyXL, spec says who cares - but it seems they didnt notice
+ xml.sheetViews { xml.sheetView }
+
if @auto_fit_data.size > 0
xml.cols {
@auto_fit_data.each_with_index do |col, index|