Skip to content

Instantly share code, notes, and snippets.

View randym's full-sized avatar

Randy Morgan randym

  • Freelance
  • Ishigaki, Japan
View GitHub Profile
@randym
randym / axlsx.example.rb
Created April 12, 2012 23:42
axlsx Generating Excel documents with Ruby
require 'axlsx'
Axlsx::Package.new do |p|
p.workbook do |wb|
styles = wb.styles
header = styles.add_style :bg_color => "DD", :sz => 16, :b => true, :alignment => {:horizontal => :center}
tbl_header = styles.add_style :b => true, :alignment => { :horizontal => :center }
ind_header = styles.add_style :bg_color => "FFDFDEDF", :b => true, :alignment => {:indent => 1}
col_header = styles.add_style :bg_color => "FFDFDEDF", :b => true, :alignment => { :horizontal => :center }
label = styles.add_style :alignment => { :indent => 1 }