This commit is contained in:
huang 2015-05-19 16:11:47 +08:00
commit 6e38895c3b
1 changed files with 6 additions and 1 deletions

View File

@ -342,10 +342,15 @@ class CoursesController < ApplicationController
def export_course_member_excel
@all_members = student_homework_score(0,0,0,"desc")
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
# 如果是ie11 需要转码
if(/rv\:11\.0/.match(request.env["HTTP_USER_AGENT"]) != nil)
filename= URI::encode(filename)
end
respond_to do |format|
format.xls {
send_data(member_to_xls(@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}.xls")
:filename => "#{filename}.xls")
}
end
end