📄 xxprint_pall.frm
字号:
VERSION 5.00
Begin VB.Form xxprint_pall
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 2265
ClientLeft = 0
ClientTop = 0
ClientWidth = 4860
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2265
ScaleWidth = 4860
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command3
Enabled = 0 'False
Height = 255
Left = 4590
TabIndex = 5
Top = 0
Width = 255
End
Begin VB.CommandButton Command2
Caption = ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
Enabled = 0 'False
Height = 255
Left = 255
TabIndex = 4
Top = 0
Width = 4335
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 255
Left = 0
TabIndex = 3
Top = 0
Width = 255
End
Begin VB.Frame Frame1
Height = 2055
Left = 0
TabIndex = 0
Top = 200
Width = 4815
Begin VB.Timer Timer1
Interval = 100
Left = 3240
Top = 1440
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Please Waiting form a monement..."
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1200
Left = 240
TabIndex = 1
Top = 480
Width = 4215
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Please Waiting form a monement..."
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 1200
Left = 220
TabIndex = 2
Top = 460
Width = 4215
End
End
End
Attribute VB_Name = "xxprint_pall"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public yy As Integer
Public jj As Integer
Public classcount As Integer
Public studentcount As Integer
Public nn As String
Sub settext(tt As String)
Label1.Caption = tt
Label2.Caption = tt
DoEvents
End Sub
Private Sub Timer1_Timer()
Dim temp As New ADODB.Recordset
temp.Open "select * from [temp] order by [xh]", main.connect, 3, 2
For i = 1 To temp.RecordCount
If i Mod 4 = 0 Then k = ". "
If i Mod 4 = 1 Then k = ".. "
If i Mod 4 = 2 Then k = "... "
If i Mod 4 = 3 Then k = "...."
Call settext("正在打印报表" & k & Chr(13) & Chr(10) & "共有" & classcunt & "个班级" & Chr(13) & Chr(10) & "正在处理第" & i & "个学生/共有" & studentcount & "个学生" & Chr(13) & Chr(10) & CInt(i * 100 / studentcount) & "%")
Call ppss(temp.Fields(0))
temp.MoveNext
Next
Call settext("处理完毕")
Unload Me
End Sub
Sub ppss(idf As Integer)
Dim temp As New ADODB.Recordset
Dim temp2 As New ADODB.Recordset
Dim temp3 As New ADODB.Recordset
temp.Open "select [class].[na] & '班' from [class],[student] where [student].[ID]=" & idf & " and [student].[clasid]=[class].[ID]", main.connect, 3, 2
bj = temp.Fields(0)
temp.Close
temp.Open "select * from [temp] where [ID]=" & idf, main.connect, 3, 2
If temp.RecordCount = 0 Then Exit Sub
wf = temp.Fields(4)
zf = temp.Fields(9)
f1 = temp.Fields(5)
f2 = temp.Fields(6)
f3 = temp.Fields(7)
f4 = temp.Fields(8)
temp.Close
temp.Open "select count([ID]) from [temp] where [zf]>" & zf, main.connect, 3, 2
mc = temp.Fields(0) + 1
temp.Close
main.connect.Execute "Delete * from [t2t2] "
temp.Open "select * from [t2t2]", main.connect, 3, 2
temp2.Open "select * from nn", main.connect, 3, 2
temp.AddNew
temp.Fields(1) = temp2.Fields(1)
temp.Fields(10) = Format(f1, "0.0")
temp.Update
temp.AddNew
temp.Fields(3) = "文化课成绩"
temp.Fields(12) = "|"
temp.Fields(10) = Format(wf, "0.0")
temp.Update
temp3.Open "select [tt1].[tkmc],[tt1].[tkmc1],[tt1].[tkmc2],[tt1].[jd],[jc].[jd],[tt1].[jd]*[jc].[jd],[jc].[bz] from [tt1],[jc] where [tt1].[ID]=[jc].[gzid] and [jc].[stid]=" & idf & " and [jc].[xn]='" & yy & "'", main.connect, 3, 2
For i = 1 To temp3.RecordCount
temp.AddNew
temp.Fields(3) = temp3.Fields(0)
If temp3.Fields(1) <> "" Then temp.Fields(4) = temp3.Fields(1)
If temp3.Fields(2) <> "" Then temp.Fields(6) = temp3.Fields(2)
temp.Fields(8) = Format(temp3.Fields(4), "0.0")
temp.Fields(9) = Format(temp3.Fields(3), "0.0")
temp.Fields(10) = Format(temp3.Fields(5), "0.0")
temp.Fields(11) = temp3.Fields(6)
temp.Fields(12) = "|"
temp.Update
temp3.MoveNext
Next
temp3.Close
temp2.MoveNext
temp.AddNew
temp.Fields(1) = temp2.Fields(1)
temp.Fields(10) = Format(f2, "0.0")
temp.Update
temp3.Open "select [tt2].[tkmc],[tt2].[tkmc1],[tt2].[tkmc2],[tt2].[jd],[jc].[jd],[tt2].[jd]*[jc].[jd],[jc].[bz] from [tt2],[jc] where [tt2].[ID]=[jc].[gzid] and [jc].[stid]=" & idf & " and [jc].[xn]='" & yy & "'", main.connect, 3, 2
For i = 1 To temp3.RecordCount
temp.AddNew
temp.Fields(3) = temp3.Fields(0)
If temp3.Fields(1) <> "" Then temp.Fields(4) = temp3.Fields(1)
If temp3.Fields(2) <> "" Then temp.Fields(6) = temp3.Fields(2)
temp.Fields(8) = Format(temp3.Fields(4), "0.0")
temp.Fields(9) = Format(temp3.Fields(3), "0.0")
temp.Fields(10) = Format(temp3.Fields(5), "0.0")
temp.Fields(11) = temp3.Fields(6)
temp.Fields(12) = "|"
temp.Update
temp3.MoveNext
Next
temp3.Close
temp2.MoveNext
temp.AddNew
temp.Fields(1) = temp2.Fields(1)
temp.Fields(10) = Format(f3, "0.0")
temp.Update
temp3.Open "select [tt3].[tkmc],[tt3].[tkmc1],[tt3].[tkmc2],[tt3].[jd],[jc].[jd],[tt3].[jd]*[jc].[jd],[jc].[bz] from [tt3],[jc] where [tt3].[ID]=[jc].[gzid] and [jc].[stid]=" & idf & " and [jc].[xn]='" & yy & "'", main.connect, 3, 2
For i = 1 To temp3.RecordCount
temp.AddNew
temp.Fields(3) = temp3.Fields(0)
If temp3.Fields(1) <> "" Then temp.Fields(4) = temp3.Fields(1)
If temp3.Fields(2) <> "" Then temp.Fields(6) = temp3.Fields(2)
temp.Fields(8) = Format(temp3.Fields(4), "0.0")
temp.Fields(9) = Format(temp3.Fields(3), "0.0")
temp.Fields(10) = Format(temp3.Fields(5), "0.0")
temp.Fields(11) = temp3.Fields(6)
temp.Fields(12) = "|"
temp.Update
temp3.MoveNext
Next
temp3.Close
temp2.MoveNext
temp.AddNew
temp.Fields(1) = temp2.Fields(1)
temp.Fields(10) = Format(f4, "0.0")
temp.Update
temp3.Open "select [tt4].[tkmc],[tt4].[tkmc1],[tt4].[tkmc2],[tt4].[jd],[jc].[jd],[tt4].[jd]*[jc].[jd],[jc].[bz] from [tt4],[jc] where [tt4].[ID]=[jc].[gzid] and [jc].[stid]=" & idf & " and [jc].[xn]='" & yy & "'", main.connect, 3, 2
For i = 1 To temp3.RecordCount
temp.AddNew
temp.Fields(3) = temp3.Fields(0)
If temp3.Fields(1) <> "" Then temp.Fields(4) = temp3.Fields(1)
If temp3.Fields(2) <> "" Then temp.Fields(6) = temp3.Fields(2)
temp.Fields(8) = Format(temp3.Fields(4), "0.0")
temp.Fields(9) = Format(temp3.Fields(3), "0.0")
temp.Fields(10) = Format(temp3.Fields(5), "0.0")
temp.Fields(11) = temp3.Fields(6)
temp.Fields(12) = "|"
temp.Update
temp3.MoveNext
Next
temp3.Close
temp.AddNew
temp.Fields(1) = "总分"
temp.Fields(10) = Format(zf, "0.0")
temp.Update
temp2.Close
temp.Close
main.connect.Execute "update [t2t2] set [t2]='|' where [t3]<>''"
main.connect.Execute "update [t2t2] set [t5]='|' where [t4]<>''"
main.connect.Execute "update [t2t2] set [t7]='|' where [t6]<>''"
temp.Open "select * from [t2t2]", main.connect, 3, 2
Dim ff As New xxprint_ppp
Set ff.DataSource = temp
temp2.Open "select * from [student] where [ID]=" & idf, main.connect, 3, 2
ff.Sections("section4").Controls.Item("label11").Caption = nn
ff.Sections("section4").Controls.Item("label3").Caption = temp2.Fields(1)
kkjk = temp2.Fields(1)
ff.Sections("section4").Controls.Item("label5").Caption = temp2.Fields(3)
If temp2.Fields(2) = True Then ff.Sections("section4").Controls.Item("label9").Caption = "男" Else ff.Sections("section4").Controls.Item("label9").Caption = "女"
If temp2.Fields(4) = 0 Then
ff.Sections("section4").Controls.Item("label7").Caption = "无"
ElseIf temp2.Fields(4) = 1 Then
ff.Sections("section4").Controls.Item("label7").Caption = "中国共青团员"
Else
ff.Sections("section4").Controls.Item("label7").Caption = "中国共产党员"
End If
ff.Sections("section4").Controls.Item("label17").Caption = mc
ff.Sections("section4").Controls.Item("label15").Caption = yy & "-" & yy + 1 & "学年"
ff.Sections("section4").Controls.Item("label13").Caption = bj
ff.Sections("section1").Controls.Item("text1").DataField = temp.Fields.Item(1).Name
ff.Sections("section1").Controls.Item("text2").DataField = temp.Fields.Item(2).Name
ff.Sections("section1").Controls.Item("text3").DataField = temp.Fields.Item(3).Name
ff.Sections("section1").Controls.Item("text4").DataField = temp.Fields.Item(4).Name
ff.Sections("section1").Controls.Item("text5").DataField = temp.Fields.Item(5).Name
ff.Sections("section1").Controls.Item("text6").DataField = temp.Fields.Item(6).Name
ff.Sections("section1").Controls.Item("text8").DataField = temp.Fields.Item(8).Name
ff.Sections("section1").Controls.Item("text9").DataField = temp.Fields.Item(9).Name
ff.Sections("section1").Controls.Item("text7").DataField = temp.Fields.Item(10).Name
ff.Sections("section1").Controls.Item("text10").DataField = temp.Fields.Item(11).Name
ff.Sections("section1").Controls.Item("text11").DataField = temp.Fields.Item(12).Name
ff.Caption = nn & " " & yy & "学年学分报表--[" & kkjk & "]"
ff.PrintReport False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -