Sha256: 4385b3094b5fb382a8ddfb5b92bf6a8d6f24c6064bdd6f6926908e0b5263e176
Contents?: true
Size: 835 Bytes
Versions: 8
Compression:
Stored size: 835 Bytes
Contents
wb = sheet.workbook styles = {} unless defined?(styles) unless styles[:bold] styles[:bold] = wb.styles.add_style :b => true end unless styles[:title] styles[:title] = wb.styles.add_style :sz => 14, :alignment => { :horizontal => :center}, :b => true end unless styles[:subtitle] styles[:subtitle] = wb.styles.add_style :sz => 12, :alignment => { :horizontal => :center}, :b => true end columns = columns || 8 subtitle = subtitle || '' sheet.add_row ["Company Name, Address"] + ['']*(columns-3) + [Date.today().to_s, Time.now().strftime("%I:%M")], :style => styles[:bold] sheet.add_row [' '] * columns sheet.add_row [title], :style => styles[:title] sheet.add_row [subtitle], :style => styles[:subtitle] sheet.merge_cells("A1:#{to_xls_col(columns-3)}1") (2..4).each {|i| sheet.merge_cells("A#{i}:#{to_xls_col(columns-1)}#{i}") }
Version data entries
8 entries across 4 versions & 1 rubygems