Skip to content
This repository
Randy Morgan (@morgan_randy)
file 12 lines (11 sloc) 0.489 kb
1 2 3 4 5 6 7 8 9 10 11
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
require 'axlsx'
xls = Axlsx::Package.new
wb = xls.workbook
wb.add_worksheet do |ws|
  # Excel does not currently follow the specification and will ignore paper_width and paper_height so if you need
  # to for a paper size, be sure to set :paper_size
  ws.page_setup.set :paper_width => "210mm", :paper_size => 10, :paper_height => "297mm", :orientation => :landscape
  ws.add_row %w(AXLSX is cool)
end
xls.serialize "page_setup.xlsx"
Something went wrong with that request. Please try again.