From 6f8311160efa63239563e89f0c5604b9be4a770f Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Tue, 14 Feb 2012 20:38:56 +0900 Subject: 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. --- lib/axlsx/workbook/worksheet/worksheet.rb | 4 ++++ 1 file changed, 4 insertions(+) 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| -- cgit v1.2.3