⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wqreppic.dsr

📁 用于电子行业打印复杂报表格式和不干胶标签
💻 DSR
字号:
VERSION 5.00
Begin {82282820-C017-11D0-A87C-00A0C90F29FC} wqreppic 
   Caption         =   "ActiveReport1"
   ClientHeight    =   5895
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   11595
   StartUpPosition =   2  '屏幕中心
   _ExtentX        =   20452
   _ExtentY        =   10398
   SectionData     =   "wqreppic.dsx":0000
End
Attribute VB_Name = "wqreppic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsTempcar As ADODB.Recordset
Dim abjctmp As String
Dim picheight As Variant '记录

Private Sub setimage() '给image赋值
Dim n, m, i As Integer

If wqabnum = 1 Then
  Image1.Left = 90: Image8.Left = 3150
End If
If wqabnum = 2 Then
  Image1.Left = 90: Image2.Left = 610
  Image8.Left = 3150: Image9.Left = 3670
End If
If wqabnum = 3 Then
  Image1.Left = 90: Image2.Left = 610: Image3.Left = 1130
  Image8.Left = 3150: Image9.Left = 3670: Image10.Left = 4190
End If
If wqabnum = 4 Then
  Image1.Left = 90: Image2.Left = 555: Image3.Left = 1020: Image4.Left = 1485
  Image8.Left = 3150: Image9.Left = 3615: Image10.Left = 4080: Image11.Left = 4545
End If
If wqabnum = 5 Then
  Image1.Left = 90: Image2.Left = 535: Image3.Left = 980: Image4.Left = 1425: Image5.Left = 1870
  Image8.Left = 3150: Image9.Left = 3595: Image10.Left = 4040: Image11.Left = 4485: Image12.Left = 4930
End If

 For i = 1 To 2
   For n = 0 To wqabnum - 1
      m = n + (i - 1) * 7 + 1
      Call loadpic(wqarray(n))
      Me.Detail.Controls("Image" & m).Picture = LoadPicture(abjctmp)
      Me.Detail.Controls("Image" & m).SizeMode = 1
      Me.Detail.Controls("Image" & m).Width = picwidth * pubabpercent
      Me.Detail.Controls("Image" & m).Height = picheight * pubabpercent
      Me.Detail.Controls("Image" & m).PictureAlignment = 2
  Next
 Next
End Sub

Private Sub loadpic(abjcstr As String)
  '调安标
 Dim ajt As String
  abjctmp = ""
  ajt = "无"
  Set rsTempcar = New ADODB.Recordset   '初始化数据库
  rsTempcar.CursorType = adOpenKeyset
  rsTempcar.CursorLocation = adUseClient
  rsTempcar.LockType = adLockOptimistic
  rsTempcar.Open "select * from 安标表 where 安标简称='" & ajt & "'", cnSys
  If abjcstr <> "" Then
      rsTempcar.Close
      rsTempcar.Open "Select * From 安标表 Where 安标简称 = '" & abjcstr & "'", cnSys
      Do While Not rsTempcar.EOF
       abjctmp = pcpath & Trim(rsTempcar("安标路径"))
       picwidth = rsTempcar("安标宽度") * stunit
       picheight = rsTempcar("安标高度") * stunit
       rsTempcar.MoveNext
      Loop
  End If
End Sub


Private Sub ActiveReport_Initialize()
  wqreppic.Printer.PaperSize = bgjpapersize
  If wqprintflag = 1 Then
    wqreppic.Printer.PrintDialog
  End If
End Sub

Private Sub ActiveReport_ReportStart()
Dim i As Integer
 '2007.01.30  cancel the code
 ' If wqabnum >= 4 Then
 '    Field3.Left = 0
 '    Field3.Width = 2800
 '    Field7.Left = 3075
 '    Field7.Width = 2800
 '   Else
 '    Field3.Left = 1110
 '    Field3.Width = 1710
 '    Field7.Left = 4200
 '    Field7.Width = 1710
 ' End If

 'If wqabnum >= 6 Then
 '  For i = 1 To 12
 '    Me.Detail.Controls("field" & i).Font.Size = 9
 '    Me.Detail.Controls("field" & i).VerticalAlignment = ddTXMiddle   '2006.06.15 add the code
 '  Next
 '  Label6.Font.Size = 9: Label7.Font.Size = 9: Label12.Font.Size = 9: Label13.Font.Size = 9
 '  Label14.Font.Size = 9: Label15.Font.Size = 9: Label16.Font.Size = 9: Label17.Font.Size = 9
 'End If
 
End Sub

Private Sub Detail_AfterPrint()
  wqprint = 0
End Sub

Private Sub setjpnull()
Dim i, kgnum As Integer
Dim tmpdy, tmpdl As String
On Error Resume Next

 For i = 1 To 10  '清空数据
   Me.Detail.Controls("Field" & i).Text = ""
 Next
 
 For i = 1 To 14
  Me.Detail.Controls("Image" & i).Picture = LoadPicture()
Next
 
tmpdy = "": tmpdl = ""
kgnum = InStr(wqratings, " ")
For i = 1 To kgnum
  tmpdy = tmpdy & Mid(wqratings, i, 1)
Next
For i = kgnum To Len(wqratings)
  tmpdl = tmpdl & Mid(wqratings, i, 1)
Next

 For i = 0 To 1
   If wqccflag = 0 Then
       Me.Detail.Controls("Field" & 1 + i * 4).Text = wqtype & "  " & wqcc & "  " & "FUSE"
     Else
      Me.Detail.Controls("Field" & 1 + i * 4).Text = wqtype
   End If
   'Me.Detail.Controls("Field" & 2 + i * 4).Text = wqratings
   Me.Detail.Controls("Field" & 2 + i * 4).Text = tmpdy & " " & tmpdl
   'Me.Detail.Controls("Field" & 3 + i * 4).Text = wqab
   Me.Detail.Controls("Field" & 4 + i * 4).Text = wqqty
 Next
 If bq6hother <> "" Then
   Field9.Text = bq6hother
   Field10.Text = bq6hother
 End If
  '2006.06.11 add the code
 If wq110flag <> "" Then
    Field11.Visible = True: Field12.Visible = True
    Field11.Text = wq110flag:  Field12.Text = wq110flag
  Else
    Field11.Visible = False: Field12.Visible = False
 End If
End Sub

Private Sub Detail_Format()
  Call setjpnull
  Call setimage    '给image赋值
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -