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

📄 frmcellprint1.frm

📁 一个用VB写的财务软件源码
💻 FRM
字号:
VERSION 5.00
Object = "{7802D41A-28B0-43C4-95EA-17B7E32337D1}#1.0#0"; "CellCtrl5.ocx"
Begin VB.Form frmcellprint1 
   ClientHeight    =   4725
   ClientLeft      =   3000
   ClientTop       =   3645
   ClientWidth     =   6390
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   4725
   ScaleWidth      =   6390
   Begin CELL50Lib.Cell Cll 
      Height          =   4455
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   6135
      _Version        =   65536
      _ExtentX        =   10821
      _ExtentY        =   7858
      _StockProps     =   0
   End
End
Attribute VB_Name = "frmcellprint1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim m_TitleTop As String
Dim m_HeadTop As String
Dim m_Width As String
Dim m_array() As String
Dim m_rSt As ADODB.Recordset
Dim m_Warray() As String

'属性

 '记录集
Public Property Let TableRst(ByVal rSt As ADODB.Recordset)
Set m_rSt = New ADODB.Recordset
m_rSt.CursorLocation = adUseClient

   Set m_rSt = rSt
End Property

'标题
Public Property Let TitleTop(ByVal tTop As String)
    m_TitleTop = tTop
End Property
'表头
Public Property Let HeadTop(ByVal hTop As String)
    m_HeadTop = hTop
End Property

'表头宽度
Public Property Let HeadWidth(ByVal hWidth As String)
   m_Width = hWidth
End Property
Public Sub cllPrint()
cll.PrintSheet 1, 0
End Sub
Public Sub cllprivew()
cll.PrintPreview 1, 0
End Sub

Public Sub Init()
Dim i As Integer
Dim j As Integer
Dim totalcols As Integer
cll.ShowHScroll True, 0
cll.ShowPageBreak flase
cll.ShowSideLabel flase, 0
cll.ShowTopLabel flase, 0
'存宽度和表头
m_Warray() = Split(m_Width, "|")
m_array() = Split(m_HeadTop, "|")

totalcols = UBound(m_array) + 1
cll.SetCols totalcols + 1, 0
'对标题操作
cll.MergeCells 1, 1, totalcols + 1, 1
cll.SetCellString 1, 1, 0, m_TitleTop
cll.SetCellAlign 1, 1, 0, 32 + 4
cll.SetDefaultRowHeight 0, 1, 30
cll.SetCellFontSize 1, 1, 0, 16

   
'对表头操作

For i = 0 To UBound(m_array)
    cll.SetCellString i + 1, 3, 0, Trim(m_array(i))
    cll.SetCellAlign i + 1, 3, 0, 32 + 4
    cll.SetDefaultRowHeight 0, 1, 20
    cll.DrawGridLine i + 1, 3, i + 1, 3, 0, 2, -1
    cll.SetColWidth 1, m_Warray(i + 1), i + 1, 0
Next
'合并
cll.MergeCells 1, 2, 4, 2
cll.MergeCells 5, 2, 7, 2
'插入记录
cll.SetRows m_rSt.RecordCount + 5, 0
i = 3
m_rSt.MoveFirst
Do Until m_rSt.EOF
 
   For j = 1 To UBound(m_array) + 1
'        cll.SetCellString j, i + 1, 0, CStr(IIf(m_rSt.Fields(j - 1) <> Null, m_rSt.Fields(j - 1), ""))
         
      If IsNull(Trim(m_rSt.Fields(j - 1))) Then
        cll.SetCellString j, i + 1, 0, ""
      Else
        cll.SetCellString j, i + 1, 0, CStr(Trim(m_rSt.Fields(j - 1)))
      End If
        cll.SetCellAlign j, i + 1, 0, 1
        cll.DrawGridLine j, i + 1, j, i + 1, 0, 2, -1
        
    Next
    m_rSt.MoveNext
    i = i + 1
Loop
cll.PrintSetTopTitle 1, 4
End Sub




Private Sub Form_Activate()
Me.ZOrder 0
End Sub

Private Sub Form_Deactivate()
Me.ZOrder 0
End Sub

Private Sub form_load()
     cll.Login "南京伊康计算机工程公司", "11010504", "0060-1733-7722-3004"
End Sub

⌨️ 快捷键说明

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