summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-15 08:32:42 +0900
committerRandy Morgan <[email protected]>2012-02-15 08:32:42 +0900
commite05bb928442aae6e026f3484745f8b99fda64aa2 (patch)
tree9d4da1c36035675e6abb44d9493a572c8330e004 /lib
parent6f8311160efa63239563e89f0c5604b9be4a770f (diff)
downloadcaxlsx-e05bb928442aae6e026f3484745f8b99fda64aa2.tar.gz
caxlsx-e05bb928442aae6e026f3484745f8b99fda64aa2.zip
more stuff to keep rubyXL happy and still get a valid doc.
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/workbook.rb2
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb
index e2a8e73e..9bb63462 100644
--- a/lib/axlsx/workbook/workbook.rb
+++ b/lib/axlsx/workbook/workbook.rb
@@ -180,6 +180,8 @@ require 'axlsx/workbook/shared_strings_table.rb'
xml.workbook(:xmlns => XML_NS, :'xmlns:r' => XML_NS_R) {
xml.workbookPr(:date1904=>@@date1904)
#<x:workbookProtection workbookPassword="xsd:hexBinary data" lockStructure="1" lockWindows="1" />
+ # Required to support rubyXL parsing as it requires sheetView, which requires this.
+ xml.bookViews { xml.workbookView :activeTab=>0 }
xml.sheets {
@worksheets.each_with_index do |sheet, index|
xml.sheet(:name=>sheet.name, :sheetId=>index+1, :"r:id"=>sheet.rId)
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 9d9317dc..5f935428 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -271,7 +271,7 @@ module Axlsx
# 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 }
+ xml.sheetViews { xml.sheetView :workbookViewId =>0 }
if @auto_fit_data.size > 0
xml.cols {