📄 bas_printinfo.bas
字号:
Attribute VB_Name = "Bas_PrintInfo"
'打印模块
'单个班组打印
Public Sub Prt_DayPlan(f As Form, SDate As Date, Bumen As String, BanZu As String)
Dim cx, cy, i As Integer
cx = 0
cy = 0
Dim BL As Integer
BL = 0
SDate = CDate(Format(SDate, "yyyy-mm-dd"))
f.Preview1.NewDoc
With f.Preview1
.Orientation = 1
.CellSize 1, 1
.Caption = "每日计划"
.PaintPicture f.Image1.Picture, 15, 7, 22, 20
.FontSize = 24
.FontBold = True
.FontName = "楷体_GB2312"
.TextL cx + 80, cy + 15, "每 日 计 划"
.FontSize = 12
.FontBold = False
.FontName = "宋体"
.TextL cx + 110, cy + 25, "班组: " & BanZu & " 生产日期: " & SDate
.FontSize = 11
.TextL cx + 8, cy + 35, "计划单"
.TextL cx + 26, cy + 35, "批次"
.TextL cx + 38, cy + 35, "客户名称"
.TextL cx + 78, cy + 35, "规格"
.TextL cx + 128, cy + 35, "数量"
.TextL cx + 125 + 18 * 1, cy + 35, "接收时间"
.TextL cx + 128 + 18 * 2, cy + 35, "完成时间"
.LineH cx + 6, cy + 40, 194
SQL = "select * from 生产计划 where 班组名称='" & BanZu & "' and 部门名称='" & Bumen & "' and DateDiff('d',生产日期,'" & SDate & "')=0"
If rs.State = 1 Then rs.Close
rs.Open SQL, DBConn, adOpenKeyset, adLockOptimistic, adCmdText
If Not rs.EOF Then
For i = 1 To rs.RecordCount
.TextL cx + 8, cy + 45 + BL, rs.Fields("计划单号").Value
.TextL cx + 26, cy + 45 + BL, rs.Fields("批次号").Value
.TextL cx + 38, cy + 45 + BL, GetCustomer(Trim(rs.Fields("计划单号").Value), Trim(rs.Fields("批次号").Value))
.TextL cx + 78, cy + 45 + BL, GetGuiGe(Trim(rs.Fields("计划单号").Value), Trim(rs.Fields("批次号").Value))
.TextL cx + 128, cy + 45 + BL, rs.Fields("完成数量").Value
.TextL cx + 128 + 18 * 1, cy + 45 + BL, Format(rs.Fields("生产时间").Value, "hh:mm")
.TextL cx + 128 + 18 * 2, cy + 45 + BL, Format(rs.Fields("完成日期").Value & " " & rs.Fields("完成时间").Value, "mm/dd hh:mm")
BL = BL + 6
rs.MoveNext
Next i
End If
End With
f.Preview1.EndDoc
f.Preview1.Preview
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -