📄
字号:
'xlApp.Visible = true
ToPrintExcel(classno)
' xlApp.Visible = false
end sub
'==============================================================
sub toPrintExcel(classno)
print_lineno = 0
'xlSheet.Cells(print_lineno,courseSelectCount/2) = rtrim(classno)+"班"+yearno.value+"年"+termno.value+"学期成绩表"
vp.Header = "|琼海师范学校"+rtrim(classno)+"班"+yearno.value+"年"+termno.value+"学期成绩表|"
' vp.Footer = " ||第%d页"
formatstr = "<+950|<+800|+400"
headstr = ""
scoreCount = rds2.Recordset.fields.count-2
for k=0 to rds2.Recordset.fields.count-1
'xlsheet.cells(print_lineno,k+1)=rds2.Recordset.fields(k).name
if k >2 and k<scoreCount then
formatstr = formatstr+ "|<+400"
end if
if K>=scoreCount then
formatstr = formatstr+ "|<+900"
end if
headstr = headstr + trim(rds2.Recordset.fields(k).name)+"|"
' msgbox headstr
next
'print_lineno = print_lineno + 1
rds2.Recordset.movefirst
while not rds2.Recordset.eof
onelinestr =""
For j = 0 To rds2.Recordset.fields.count-1
If isnull(rds2.Recordset.fields(j))=false then ' or trim(rds1.Recordset.fields(j))<>"" then
if IsNumeric(rds2.Recordset.fields(j)) = true Then
'xlSheet.Cells(print_lineno, j + 1) = trim(cstr(rds2.Recordset.fields(j)))
if j <>0 and j <>scoreCount +1 then
onelinestr = onelinestr + trim(cstr(formatnumber(rds2.Recordset.fields(j),0))) +"|"
' msgbox onelinestr
else
onelinestr = onelinestr + trim(cstr(rds2.Recordset.fields(j))) +"|"
'msgbox onelinestr
end if
else
'xlSheet.Cells(print_lineno, j + 1) = trim(cstr(rds2.Recordset.fields(j)))
onelinestr = onelinestr + trim(cstr(rds2.Recordset.fields(j))) +"|"
' msgbox onelinestr
End If
else ' It is Null
onelinestr = onelinestr + "|"
' msgbox onelinestr
end if
Next
print_lineno=print_lineno+1
if print_lineno = 1 then
vp.AddTable formatstr,headstr,onelinestr,,,false
else
vp.AddTable formatstr,headstr,onelinestr,,,true
end if
rds2.Recordset.movenext
wend
end sub
'========按班、年级及学号取某学年某学期所开所的课程======
sub get_course(classno,get_type)
courseSelectCount = 0
select case get_type
case "CLASS"
rds2.SQL = " select 课程号 from class_course where 班号='"+classno+"' and "&_
" 学年='"+yearno.value+"' and 学期='"+termno.value+"'"
case "XH"
rds2.SQL = "select a.课程号 from class_course as a,student as b where b.学号>='"+rtrim(startno.value)+"' and "&_
" b.学号<='"+rtrim(endno.value)+"' and b.班号=a.班号 and "&_
" 学年='"+yearno.value+"' and 学期='"+termno.value+"' group by a.课程号"
case "GRADE"
rds2.SQL = " select 课程号 from class_course where 班号 in (select 班号 from class where year(入学年度)='"+rtrim(gradeno.value)+"') and "&_
" 学年='"+yearno.value+"' and 学期='"+termno.value+"' group by 课程号"
end select
'msgbox rds2.sql
rds2.ExecuteOptions = 1
rds2.Refresh
courseSelectCount = rds2.Recordset.recordcount
if courseSelectCount <=0 then
exit sub
end if
'courseSelectArray= rds2.recordset.Getrows(rds2.recordset.recordcount,0,0)
'courseSelectArray= rds2.recordset.Getrows(rds2.recordset.recordcount,0,0)
rds2.Recordset.movefirst
for i=0 to rds2.recordset.recordcount-1
courseSelectArray(0,i)=rds2.Recordset.fields(0)
rds2.Recordset.movenext
next
end sub
'==============根据序列号从开设课程数组中取课程名称=================
function GetCourseName(cno)
GetCourseName = "No Find"
for loopcount = 0 to courseCount-1
if courseNoArray(0,loopcount) = courseSelectArray(0,cno) then
GetCourseName = courseArray(0,loopcount)
exit for
end if
next
end function
'===========================================================
sub scoreFillOrder() '成绩排序,填写名次
loopcount = rds2.Recordset.recordcount
rds2.recordset.Movefirst
for i = 0 to loopcount-1
rds2.recordset.fields(2).value = cstr(i+1)
rds2.Recordset.movenext
next
rds2.recordset.Movefirst
end sub
'===============================================
sub returning()
history.go(-1)
end sub
'==============================================================
</script>
<!--<OBJECT classid=clsid:6E84D662-9599-11D2-9367-20CC03C10627
height=3 id=vp width =3 VIEWASTEXT>
</OBJECT> -->
<OBJECT classid=clsid:6E84D662-9599-11D2-9367-20CC03C10627 height=130 id=vp
style="HEIGHT: 375px; WIDTH: 744px" width=300 VIEWASTEXT>
<PARAM NAME="_cx" VALUE="19685">
<PARAM NAME="_cy" VALUE="9922">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="BackColor" VALUE="2147483653">
<PARAM NAME="Font" VALUE="Arial">
<PARAM NAME="HdrFont" VALUE="Courier New">
<PARAM NAME="_ConvInfo" VALUE="1">
<PARAM NAME="AutoRTF" VALUE="-1">
<PARAM NAME="Preview" VALUE="-1">
<PARAM NAME="DefaultDevice" VALUE="0">
<PARAM NAME="PhysicalPage" VALUE="-1">
<PARAM NAME="AbortWindow" VALUE="-1">
<PARAM NAME="AbortWindowPos" VALUE="0">
<PARAM NAME="AbortCaption" VALUE="Printing...">
<PARAM NAME="AbortTextButton" VALUE="Cancel">
<PARAM NAME="AbortTextDevice" VALUE="on the %s on %s">
<PARAM NAME="AbortTextPage" VALUE="Now printing Page %d of">
<PARAM NAME="FileName" VALUE="">
<PARAM NAME="MarginLeft" VALUE="1440">
<PARAM NAME="MarginTop" VALUE="1440">
<PARAM NAME="MarginRight" VALUE="1440">
<PARAM NAME="MarginBottom" VALUE="1440">
<PARAM NAME="MarginHeader" VALUE="0">
<PARAM NAME="MarginFooter" VALUE="0">
<PARAM NAME="IndentLeft" VALUE="0">
<PARAM NAME="IndentRight" VALUE="0">
<PARAM NAME="IndentFirst" VALUE="0">
<PARAM NAME="IndentTab" VALUE="720">
<PARAM NAME="SpaceBefore" VALUE="0">
<PARAM NAME="SpaceAfter" VALUE="0">
<PARAM NAME="LineSpacing" VALUE="100">
<PARAM NAME="Columns" VALUE="1">
<PARAM NAME="ColumnSpacing" VALUE="180">
<PARAM NAME="ShowGuides" VALUE="2">
<PARAM NAME="LargeChangeHorz" VALUE="300">
<PARAM NAME="LargeChangeVert" VALUE="300">
<PARAM NAME="SmallChangeHorz" VALUE="30">
<PARAM NAME="SmallChangeVert" VALUE="30">
<PARAM NAME="Track" VALUE="0">
<PARAM NAME="ProportionalBars" VALUE="-1">
<PARAM NAME="Zoom" VALUE="25">
<PARAM NAME="ZoomMode" VALUE="3">
<PARAM NAME="ZoomMax" VALUE="400">
<PARAM NAME="ZoomMin" VALUE="10">
<PARAM NAME="ZoomStep" VALUE="5">
<PARAM NAME="MouseZoom" VALUE="2">
<PARAM NAME="MouseScroll" VALUE="-1">
<PARAM NAME="MousePage" VALUE="-1">
<PARAM NAME="EmptyColor" VALUE="2147483660">
<PARAM NAME="TextColor" VALUE="0">
<PARAM NAME="HdrColor" VALUE="0">
<PARAM NAME="BrushColor" VALUE="0">
<PARAM NAME="BrushStyle" VALUE="0">
<PARAM NAME="PenColor" VALUE="0">
<PARAM NAME="PenStyle" VALUE="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -