VB+SQL Server IC卡考勤管理系统 第6页
Dim CurY As Single
Dim FixedX As Integer
Dim RowH As Integer '行高
Dim TopH As Integer '顶边距
Dim DataRows As Integer
Dim ForTimes As Integer
Dim Str As String
DataRows = msfGrid.Rows - 1
Const Rows = 35
Const Sr = 56.7
FixedX = Sr * 5
Dim i As Integer
Dim OldFontSize As Integer
Dim Lines As Integer
Dim StartLine As Integer
On Error GoTo PrintErr
With objPrint
RowH = .TextHeight("A") * 2
OldFontSize = .FontSize
TopH = 20 * Sr
For ForTimes = 1 To DataRows \ Rows + 1
'打印标题
CurY = TopH
CurX = FixedX
Str = Trim(Me.Caption)
CurX = (.Width - .TextWidth(Str) - FixedX - 200) / 2
.CurrentX = CurX
.CurrentY = CurY
.FontSize = 16
.Font.Bold = True
objPrint.Print Str
.FontBold = False
'打印条件
If optSel(mNOTCARD).Value Then
Str = optSel(mNOTCARD).Caption & Space(5) & Trim(Label1(0)) & Space(1) & Trim(txtDate(0))
Else
If optSel(mALL).Value Then
Str = optSel(mALL).Caption
Else
Str = optSel(mLATE).Caption
End If
Str = Str & Space(5) & Trim(Label1(0)) & Space(1) & Trim(txtDate(0)) _
& Space(5) & Trim(Label1(2)) & Space(1) & Trim(cboDept.Text)
需要完整内容的请联系QQ3249114,本文免费,转发请注明源于www.751com.cn
objPrint.Print Str
.FontItalic = False
'直线
.CurrentX = FixedX
CurY = CurY + RowH - 100
.CurrentY = CurY
objPrint.Line (FixedX, CurY)-(Printer.Width - FixedX - 100, CurY), RGB(0, 0, 0)
'打印明细栏
.FontBold = True
.FontSize = 13
.CurrentX = FixedX
CurY = CurY + RowH - 180
.CurrentY = CurY/
With msfGrid
//…代With msfGrid
objPrint.Print Trim(.TextMatrix(0, 0)); Tab(12) ;
Trim(.TextMatrix(0, 1)); Tab(23) ;
Trim(.TextMatrix(0, 2)); Tab(30) ;
Trim(.TextMatrix(0, 3)); Tab(42) ;
Trim(.TextMatrix(0, 4)); Tab(53);
Trim(.TextMatrix(0, 5));
End With
PrintErr:
MsgBox Err.Description, vbCritical, gTitle
Err.Clear
If TypeOf objPrint Is Printer Then
objPrint.KillDoc
Else
End If
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] 下一页