18 lines
362 B
Plaintext
18 lines
362 B
Plaintext
|
# encoding: utf-8
|
||
|
|
||
|
|
||
|
wb = xlsx_package.workbook
|
||
|
|
||
|
wb.add_worksheet(name: "Table") do |sheet|
|
||
|
heading = sheet.styles.add_style(:b => true, :locked => true)
|
||
|
headings = @tablecolumns.collect{|tc| tc.title}
|
||
|
sheet.add_row headings, :style => heading
|
||
|
|
||
|
@rows.each do |r|
|
||
|
row = []
|
||
|
r["columns"].each do |col|
|
||
|
row << col["text"]
|
||
|
end
|
||
|
sheet.add_row row
|
||
|
end
|
||
|
end
|