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

📄 employeeprint.dsr

📁 即时通讯
💻 DSR
📖 第 1 页 / 共 2 页
字号:
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType11      =   4
      BeginProperty Item11 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Text2"
         Object.Left            =   1701
         Object.Top             =   2268
         Object.Width           =   1701
         Object.Height          =   567
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16711680
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType12      =   4
      BeginProperty Item12 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Text3"
         Object.Left            =   1701
         Object.Top             =   3402
         Object.Width           =   1701
         Object.Height          =   567
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16711680
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType13      =   4
      BeginProperty Item13 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Text4"
         Object.Left            =   1701
         Object.Top             =   2835
         Object.Width           =   1710
         Object.Height          =   570
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16711680
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      ItemType14      =   4
      BeginProperty Item14 {1C13A8E2-A0B6-11D0-848E-00A0C90DC8A9} 
         _Version        =   393216
         Name            =   "Text5"
         Object.Left            =   567
         Object.Top             =   567
         Object.Width           =   1125
         Object.Height          =   570
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
   EndProperty
   SectionCode3    =   7
   BeginProperty Section3 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Section3"
      NumControls     =   0
   EndProperty
   SectionCode4    =   8
   BeginProperty Section4 {1C13A8E0-A0B6-11D0-848E-00A0C90DC8A9} 
      _Version        =   393216
      Name            =   "Section5"
      NumControls     =   0
   EndProperty
End
Attribute VB_Name = "EmployeePrint"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "RVB_ModelStereotype" ,"DataReport"
'**************************************
'*    模 块 名 称 :应用程序启动窗体
'*    功 能 描 述 :应用程序启动窗体
'*    程序员姓名  :
'*    最后修改人  :
'*    最后修改时间:2005
'**************************************
Option Explicit

Private m_queryDAO As QueryDAO         ' 查询数据库操作类
Private m_recordset As ADODB.Recordset ' 数据操作数据集对象
Private m_dao As ImageDAO
Dim pictureid As String

Private imageDataArr() As Byte      ' 图像文件读入后保存的字节数组
Private imageName As String         ' 图像文件名

Private m_label As RptLabel

'**************************************
'*    功 能 描 述 :查找打印数据并与打印控件帮定
'*    输 入 参 数 :employIdList - 要打印员工证的员工ID列表
'*    输 出 能 数 :无
'**************************************
Public Function PrintData(employIdList As String)
    Dim ret As Boolean
    Dim txt As New Collection
    Dim ctl As Object
    Dim sql As String             ' 查询语句

    ' 构造查询语句
    sql = "SELECT * FROM VIEW_Employee " + _
          "WHERE  EmployeeID IN (" + employIdList + ")"
    
    ' 执行查询操作
    ret = m_queryDAO.ExecuteQuery(m_recordset, sql)
    Set Me.DataSource = m_recordset
   
    Me.Sections("section2").Controls("Label6").caption = "动态新增"
    
   
    Me.Sections("section1").Controls("Text1").DataField = m_recordset.Fields("Name").name
    Me.Sections("section1").Controls("Text2").DataField = m_recordset.Fields("LocalDepartment").name
    Me.Sections("section1").Controls("Text3").DataField = m_recordset.Fields("Native").name
    Me.Sections("section1").Controls("Text4").DataField = m_recordset.Fields("Job").name
    Me.Sections("section1").Controls("Text5").DataField = m_recordset.Fields("pictureid").name
    
    
'    LoadPictureid Trim(Me.Sections("section1").Controls("Text5"))
    LoadPictureid Trim(m_recordset.Fields("pictureid"))

End Function

Private Sub DataReport_Initialize()
    Set m_queryDAO = New QueryDAO
    Set m_recordset = New ADODB.Recordset
    Set m_dao = New ImageDAO
End Sub

'**************************************
'*    功 能 描 述 :载入一个图记录的图片数据
'*    输 入 参 数 :imageId  - 图片ID
'*    输 出 能 数 :无
'**************************************
Private Function LoadPictureid(imageId As String)
    Dim ret As Boolean
    Dim fileLen As Long      ' 图片的长度
    Dim bufferfile As Long
    Dim current As String
    Dim recSet As ADODB.Recordset    ' 数据集
    
    Set recSet = New ADODB.Recordset
    
    ret = m_dao.FindImageById(recSet, imageId)
    
    If ret Then
        fileLen = recSet.Fields("imageDate").ActualSize          '得到office字段中的文件数据的大小
        ReDim imageDataArr(fileLen)
        imageDataArr() = recSet.Fields("imageDate").GetChunk(fileLen) '将字段中数据写入动态数组中
        
        bufferfile = FreeFile()
        Open "tempfile.bmp" For Binary Access Read Write As #bufferfile '打开一个临时文件
        Put bufferfile, , imageDataArr '将动态数组FileArr中的数据写入临时文件tempfile中
        current = CurDir & "\tempfile.bmp" '获取临时文件的全路径
    '    WebBrowser1.Navigate current '在WebBrowser控件中显示文件内容
        Set Me.Sections.Item("Section1").Controls.Item("Image1").Picture = LoadPicture(current)
    End If
    
    recSet.Close
    
    Set recSet = Nothing
End Function

⌨️ 快捷键说明

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