📄
字号:
<%
dim Pri
Pri=CheckUrl("成绩报表管理")
%>
<!--#include virtual="/school/public/CheckUrl.asp"-->
<%
vServer="http://" & Request.ServerVariables("Server_name")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>打印班级毕业成绩表 write by longZhiping on 1999.8.26</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body background="../../images/di2001.jpg">
<p><font color="#0000a0" size="6"><strong>打印班级毕业成绩表</strong>
<object id="rds1" classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" width="0" height="0">
</object>
<object id="rds3" classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" width="0" height="0"></object>
</font><br><img src="../../images/Slidbar.gif" width="760">
<div align="center"><center>
<table border="1" width="760" height="325">
<tr>
<td width="610" height="325" valign="top"><p align="center">
<OBJECT classid=clsid:00028CD1-0000-0000-0000-000000000046
CODEBASE="http://<%=Request.ServerVariables("SERVER_NAME")%>/school/public/tdbg6.ocx"
dataSrc=#rds1 height=350 id=grid1 style="LEFT: 0px; TOP: 0px"
width=600 VIEWASTEXT></OBJECT></p>
</td>
<td width="136" height="325" valign="top">
</P>
<hr color="#0000ff">
<P align="center"><input type="button" value="开始打印" onclick="beginPrint()" name="start_input" style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 14px" >
<P align="center"><input type="button" value="全部打印" onclick="Allprint()" name="all_print" style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 14px" >
<P align="center"><input type="button" value="全部取消" onclick="AllNoprint()" name="all_no_print" style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 14px" >
<P align="center"><input type="button" value="退出返回" onclick="returning()" name="exiting" style="COLOR: rgb(0,0,255); FONT-FAMILY: 宋体; FONT-SIZE: 14px" >
</P></td></tr>
</table>
</center></div>
<script language="Vbscript">
dim courseNoArray(0,100),courseArray(0,100),yearnoArray(0,100),termnoArray(0,100),xhArray(0,100),xmArray(0,100),courseSelectArray(0,100)
dim courseCount,termCount,XHCount,courseSelectCount
dim course_sql
dim total_score
dim print_lineno
dim havedCourseArray(0,200),havedCourseCount '所有开设过的课程数组和课程数目
dim formatstr,headstr
dim bodyline(100)
print_lineno=0
RDS1.Server = "http://<%=REQUEST.SERVERVARIABLES("SERVER_NAME")%>"
RDS1.Connect="database=school;uid=sa;pwd=;dsn=school"
rds3.server = "http://<%=REQUEST.SERVERVARIABLES("SERVER_NAME")%>"
rds3.connect ="database=school;uid=sa;pwd=;dsn=school"
rds1.SQL = "Execute createTempclass "
rds1.ExecuteOptions = 1
rds1.Refresh
'Set xlApp = CreateObject("Excel.Application")
'xlApp.Visible = false
'Set xlBook =xlApp.Workbooks.Add
'Set xlSheet = xlBook.Worksheets(1)
'下面从数据库中取得课程名称,课程代码
'rds3.sql = "select * from course"
'rds3.ExecuteOptions = 1
'rds3.refresh
'courseArray = rds3.recordset.Getrows(rds3.recordset.recordcount,0,1)
'rds3.Recordset.movefirst
'courseNoArray= rds3.recordset.Getrows(rds3.recordset.recordcount,0,0)
'courseCount = rds3.Recordset.recordcount
rds3.sql = "select * from course"
rds3.ExecuteOptions = 1
rds3.refresh
'courseArray = rds3.recordset.Getrows(rds3.recordset.recordcount,0,1)
'rds3.Recordset.movefirst
'courseNoArray= rds3.recordset.Getrows(rds3.recordset.recordcount,0,0)
courseCount = rds3.Recordset.recordcount
rds3.Recordset.movefirst
for i=0 to rds3.recordset.recordcount-1
courseArray(0,i)=rds3.Recordset.fields(1)
courseNoArray(0,i)=rds3.Recordset.fields(0)
rds3.Recordset.movenext
next
sub beginPrint()
'根据用户的选择,一班接一班依次打印
vp.Preview = true
vp.StartDoc
rds1.recordset.movefirst
allrecords=rds1.Recordset.recordcount
for i =1 to allrecords
if rds1.Recordset.fields(2).value="打 印" then
call ToClassprint(rds1.Recordset.fields(0).value)
end if
rds1.Recordset.movenext
next
rds1.Recordset.movefirst
vp.EndDoc
'vp.SaveDoc "c:\xkprint.prn"
'window.open "http://<%=REQUEST.SERVERVARIABLES("SERVER_NAME")%>/school/public/print.asp"
end sub
sub Allprint()
rds1.recordset.movefirst
allrecords=rds1.Recordset.recordcount
for i =1 to allrecords
rds1.Recordset.fields(2).value="打 印"
rds1.Recordset.movenext
next
rds1.recordset.movefirst
end sub
sub AllNoprint()
rds1.recordset.movefirst
allrecords=rds1.Recordset.recordcount
for i =1 to allrecords
rds1.Recordset.fields(2).value="不打印"
rds1.Recordset.movenext
next
rds1.recordset.movefirst
end sub
'===================================================
sub grid1_BeforeColEdit(colindex,keyascii,cancel)
set colsel = grid1.columns.item(colindex)
select case colsel.caption
case "打印状态"
'colsel.button = true
if grid1.columns.item(colindex).value = "打 印" then
grid1.columns.item(colindex).value = "不打印"
else
grid1.columns.item(colindex).value = "打 印"
end if
cancel = true
case else
cancel = true
end select
end sub
'===================================================
sub ToClassPrint(classno) '打印一班的毕业成绩表
'===================================================
call GetHavedCourseno(classno)
if HavedCourseCount <=0 then
msgbox "此班到现在为止,还没有开设过课程!"
exit sub
end if
call getYearTerm(classno)
if termCount <=0 then
msgbox "此班到现在为止,还没有上过一个学期的课程!"
exit sub
end if
call getXh(classno)
if XHCount <=0 then
msgbox "此班没有学生!"
exit sub
end if
'xlApp.Visible = true
for xhloop = 0 to xhCount -1
call print_head(classno,xhloop)
call print_kcm()
call print_body(classno,xhloop)
'exit sub
next
end sub
'=================================================
sub print_head(classno,xhno) '打印表头
'=================================================
print_lineno = print_lineno + 3
'打印表头
'xlSheet.Cells(print_lineno, termCount/2) = "学生毕业成绩表"
'xlSheet.Cells(print_lineno+1,termCount/2) = "————————"
'print_lineno = print_lineno +2
'xlSheet.Cells(print_lineno, 1) = " 班号:"
'xlSheet.Cells(print_lineno, 2) = trim(classno)
'xlSheet.Cells(print_lineno, 3) = " 学号:"
'xlSheet.Cells(print_lineno, 4) = trim(xhArray(0,xhno))
'xlSheet.Cells(print_lineno, 5) = " 姓名:"
'xlSheet.Cells(print_lineno, 6) = trim(xmArray(0,xhno))
'print_lineno = print_lineno +1
head1 = "班号:"&trim(classno) &" 学号:" & trim(xhArray(0,xhno)) & " 姓名:" & trim(xmArray(0,xhno))
vp.header="|琼海师范学校学生毕业成绩表" & vbLf & head1 & "|"
formatstr = "<+2000|"
headstr = "课 程 名|"
'xlSheet.Cells(print_lineno, 1) = "课程名"
for i=0 to termCount -1
'xlSheet.Cells(print_lineno, 2+i) = yearnoArray(0,i)+termnoArray(0,i)
formatstr = formatstr + "^+1200|"
headstr = headstr + yearnoArray(0,i)+termnoArray(0,i)+"|"
next
headstr = headstr + " 备 注"
'print_lineno = print_lineno +1
end sub
'==================================================
sub print_kcm() '在最左列打印课程名
'==================================================
for kcloop = 0 to HavedCourseCount - 1
'xlSheet.Cells(print_lineno+kcloop, 1) = GetCourseName(kcloop) '打印课程名
'vp.TableCell(tcText,kcloop+1,1) = GetCourseName(kcloop)
llength=len(trim(GetCourseName(kcloop)))
'msgbox llength
if llength=2 then
' msgbox "1"
lkcm1=mid(trim(GetCourseName(kcloop)),1,1)
lkcm2=mid(trim(GetCourseName(kcloop)),2,1)
' msgbox lkcm1
lkcm1=replace(GetCourseName(kcloop),lkcm1,lkcm1+space(2))
bodyline(kcloop) = trim(lkcm1)+"|"
else
bodyline(kcloop) = trim(GetCourseName(kcloop))+"|"
end if
'bodyline(kcloop) = trim(GetCourseName(kcloop))+"|"
' bodyline(kcloop) = trim(lkcm1)+"|"
next
end sub
'===================================================
sub print_body(classno,xhno) '打印表体,即成绩内容
'===================================================
dim tmpvalue,linenum
for termloop =0 to termCount - 1 '一门课程找出所有学期的成绩
call get_course(classno,termloop)
if courseSelectCount <= 0 then
'msgbox "本学期没有开设课程!"
end if
rds3.sql = " select "
for cno = 0 to courseSelectCount - 1
rds3.SQL = rds3.SQL + trim(courseSelectArray(0,cno)) +","
next
rds3.SQL = rds3.SQL +"'LZP' from score where"&_
" 学号='"+xhArray(0,xhno)+"' and 学年='"+yearnoArray(0,termloop)+"' and "&_
" 学期='"+termnoArray(0,termloop)+"' and 成绩类型='总评成绩'"
rds3.ExecuteOptions = 1
rds3.Refresh
if rds3.Recordset.recordcount >0 then
tmpvalue = null
for cno = 0 to courseSelectCount - 1
tmpvalue = rds3.Recordset.fields(cno).value
linenum = GetPrintLine(cno)
if isnull(tmpvalue) then
'xlSheet.Cells(print_lineno+linenum, 2+termloop) = " "
bodyline(linenum) = bodyline(linenum) + " |"
else
'xlSheet.Cells(print_lineno+linenum, 2+termloop) = trim(cstr(tmpvalue))
bodyline(linenum) = bodyline(linenum) +trim(cstr(tmpvalue))+"|"
end if
next
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -