2020-02-05 07:37:10 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
wb = xlsx_package.workbook
|
|
|
|
wb.add_worksheet(name: "school_class") do |sheet|
|
|
|
|
row = []
|
|
|
|
title = sheet.styles.add_style(:bg_color => "FFFF00",:border=>{ :style => :thin, :color => "666666" },:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true})
|
|
|
|
column = sheet.styles.add_style(:alignment=>{ :horizontal => :center,:vertical => :center ,:wrap_text => true},:border=>{ :style => :thin, :color => "666666" })
|
|
|
|
@fields.each do |field|
|
|
|
|
row << t('olympiamanagement.'+field)
|
|
|
|
end
|
|
|
|
sheet.add_row row , :style=> title,:widths => row.map{|cell| (cell.length* 11/ 2).round}
|
|
|
|
@student_data_list.each do |infos_row|
|
2020-03-05 04:05:37 +00:00
|
|
|
sheet.add_row infos_row , :style=> column , :types => :string
|
2020-02-05 07:37:10 +00:00
|
|
|
end
|
|
|
|
end
|