我在滑轨中使用axlsx
宝石,需要在横向上产生出色的效果
wb = xlsx_package.workbook
wb.add_worksheet(name: "Semestre") do |sheet|
sheet.add_row ["Período", "Turma", "Sala", "Disciplina", "Tipo", "Híbrida", "Dia da Semana", "Hora Inicial", "Hora Final", "CH", "Curso", "Professor", "Matrícula"]
@oferta.each do |oferta|
if oferta.sala_id != nil
sala=oferta.sala.nome
else
sala="-"
end
sheet.add_row [oferta.periodo, oferta.codturma, sala, oferta.disciplinaturma.disciplina.nome, oferta.tipoaula, oferta.disciplinaturma.disciplina.hibrida, oferta.diasemana, oferta.horainicial.try(:strftime, ("%H:%M")), oferta.horafinal.try(:strftime, ("%H:%M")), oferta.cargahoraria.to_s+" h", oferta.disciplinaturma.turma.curso.nome, oferta.professor.nome, oferta.professor.matricula]
结束 结束