📄 к+
字号:
<%
dim Pri
Pri=CheckUrl("成绩报表管理")
%>
<!--#include virtual="/school/public/CheckUrl.asp"-->
<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
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 print_lineno,xhCount,havedCourseCount
print_lineno=0
havedCourseCount = 18
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)
sub beginPrint()
'根据用户的选择,一班接一班依次打印
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
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) '打印一班的毕业成绩表
'===================================================
xlApp.Visible = true
call print_head(classno)
call print_name(classno)
end sub
'=================================================
sub print_head(classno) '打印表头
'=================================================
print_lineno = print_lineno + 3
'打印表头
xlSheet.Cells(print_lineno, havedCourseCount/2-2) = "学生成绩登记表"
xlSheet.Cells(print_lineno+1,havedCourseCount/2-2) = "———————"
print_lineno = print_lineno +2
xlSheet.Cells(print_lineno, 1) = " 班级:"
xlSheet.Cells(print_lineno, 2) = trim(classno)
xlSheet.Cells(print_lineno+1,1) =" 学号"
xlSheet.Cells(print_lineno+1,2) =" 姓名"
xlSheet.Cells(print_lineno+1,9) = " 段考"
xlSheet.Cells(print_lineno+1,16) = " 期考"
xlSheet.Cells(print_lineno+1,17) = " 总评"
xlSheet.Cells(print_lineno+1,18) = " 备注"
print_lineno = print_lineno +2
end sub
'====================================================
sub print_name(classno) '在左边打印学号,姓名
'====================================================
rds3.sql = "select 学号,姓名 from baseinfo where 班号='"+classno+"' order by 学号 ASC"
rds3.ExecuteOptions =1
rds3.Refresh
xhCount = rds3.Recordset.recordcount
if xhCount <=0 then
msgbox "没有找到此班的学生"
exit sub
end if
for xhloop = 0 to xhCount - 1
xlSheet.Cells(print_lineno+xhloop, 1) = rds3.Recordset.fields(0).value '打印学号
xlSheet.Cells(print_lineno+xhloop, 2) = rds3.Recordset.fields(1).value '打印姓名
rds3.Recordset.MoveNext
next
print_lineno=print_lineno + xhCount +1
end sub
'=======================================================
sub returning() '返回上一层程序
'=======================================================
history.go(-1)
end sub
'==============================================================
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -