osem-fcy/app/views/admin/registrations/index.xlsx.axlsx

26 lines
783 B
Text
Raw Normal View History

2013-07-16 09:47:23 +02:00
wb = xlsx_package.workbook
wb.add_worksheet(:name => "registrations") do |sheet|
bold_style = wb.styles.add_style(:b => true)
row = ["Attended", "Name", "Nickname", "Affilation", "Email", "Social events",
"With partner", "Needs access", "Other needs", "Arrival", "Departure"]
sheet.add_row row, :style => bold_style
@registrations.each do |reg|
row = []
row << reg.attended
2014-06-23 19:07:50 +03:00
row << reg.name
row << reg.nickname
row << reg.affiliation
2013-07-16 09:47:23 +02:00
row << reg.email
row << reg.attending_social_events
row << reg.attending_with_partner
2014-06-13 12:12:17 +03:00
row << reg.handicapped_access_required
2013-07-16 09:47:23 +02:00
row << reg.other_needs
row << reg.arrival
row << reg.departure
sheet.add_row row
end
sheet.column_info[8].width = [sheet.column_info[8].width, 30].min
2014-06-23 19:07:50 +03:00
end
2013-07-16 09:47:23 +02:00