-1
是否可以使用gem axlsx在xlsx中使用多個工作表導出。如果不是,請給我建議其他方式。Rails gem axlsx gem多張
我想在不同的工作表中輸出@search,@searchg,@clients,@overtimes的值。
@search = Operation.where(:date => params[:from_date].to_datetime..(params[:to_date].to_datetime + 1.day))
@searchg = Guard.where(:status => true).where(:induction_date => params[:from_date].to_datetime..(params[:to_date].to_datetime + 1.day))
@searcht = Guard.where(:status => false).where(:terminate_date => params[:from_date].to_datetime..(params[:to_date].to_datetime + 1.day))
@clients = Client.where(:status => false).where(:terminate_date => params[:from_date].to_datetime..(params[:to_date].to_datetime + 1.day))
@overtimes = Overtime.where(:date => params[:from_date].to_datetime..(params[:to_date].to_datetime + 1.day))
respond_to do |format|
format.js
format.xlsx {render xlsx: 'report', filename: "Operation_reports_#{params[:from_date]}_#{params[:to_date]}.xlsx"}
end