blob: 67a3eeb036849f766743fca95d6371de44d6c958 (
plain)
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"
|