version 1.103, 2004/02/26 22:42:21
|
version 1.104, 2004/02/27 14:59:19
|
Line 1145 sub print_html_classlist {
|
Line 1145 sub print_html_classlist {
|
foreach my $outputformat ('html','csv','excel') { |
foreach my $outputformat ('html','csv','excel') { |
my $option = '<option value="'.$outputformat.'" '; |
my $option = '<option value="'.$outputformat.'" '; |
if ($outputformat eq $ENV{'form.state'}) { |
if ($outputformat eq $ENV{'form.state'}) { |
$option .= 'checked '; |
$option .= 'selected '; |
} |
} |
$option .='>'.$lt{$outputformat}.'</option>'; |
$option .='>'.$lt{$outputformat}.'</option>'; |
$output_selector .= "\n".$option; |
$output_selector .= "\n".$option; |
Line 1183 sub show_class_list {
|
Line 1183 sub show_class_list {
|
my $cid=$ENV{'request.course.id'}; |
my $cid=$ENV{'request.course.id'}; |
# |
# |
# Variables for excel output |
# Variables for excel output |
my ($excel_workbook, $excel_sheet, $excel_filename,$row); |
my ($excel_workbook, $excel_sheet, $excel_filename,$row,$format); |
# |
# |
# Variables for csv output |
# Variables for csv output |
my ($CSVfile,$CSVfilename); |
my ($CSVfile,$CSVfilename); |
Line 1267 END
|
Line 1267 END
|
$excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'. |
$excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'. |
$excel_filename); |
$excel_filename); |
$excel_workbook->set_tempdir('/home/httpd/perl/tmp'); |
$excel_workbook->set_tempdir('/home/httpd/perl/tmp'); |
|
# |
|
$format = &Apache::loncommon::define_excel_formats($excel_workbook); |
$excel_sheet = $excel_workbook->addworksheet('classlist'); |
$excel_sheet = $excel_workbook->addworksheet('classlist'); |
# |
# |
my $description = 'Class List for '. |
my $description = 'Class List for '. |
$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; |
$excel_sheet->write($row++,0,$description); |
$excel_sheet->write($row++,0,$description,$format->{'h1'}); |
# |
# |
$excel_sheet->write($row++,0,["username","domain","ID", |
$excel_sheet->write($row++,0,["username","domain","ID", |
"student name","section","status"]); |
"student name","section","status"],$format->{'bold'}); |
} |
} |
# |
# |
# Sort the students |
# Sort the students |