📄 bb2.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Bb2
BackColor = &H80000009&
Caption = "报表"
ClientHeight = 6900
ClientLeft = 60
ClientTop = 345
ClientWidth = 10995
LinkTopic = "Form1"
ScaleHeight = 6900
ScaleWidth = 10995
StartUpPosition = 1 '所有者中心
WindowState = 2 'Maximized
Begin MSHierarchicalFlexGridLib.MSHFlexGrid Grid
Height = 6975
Left = 120
TabIndex = 0
Top = 1800
Width = 9600
_ExtentX = 16933
_ExtentY = 12303
_Version = 393216
Cols = 4
BackColorFixed = -2147483628
BackColorBkg = -2147483628
AllowBigSelection= 0 'False
AllowUserResizing= 3
Appearance = 0
RowSizingMode = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_NumberOfBands = 1
_Band(0).Cols = 4
End
Begin MSComctlLib.ImageList ImageList1
Left = 1800
Top = 960
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 30
ImageHeight = 25
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Bb2.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Bb2.frx":0112
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Bb2.frx":0564
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Bb2.frx":0AA6
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Bb2.frx":0FE8
Key = ""
EndProperty
EndProperty
End
Begin MSComDlg.CommonDialog setup
Left = 240
Top = 1200
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 765
Left = 0
TabIndex = 2
Top = 0
Width = 10995
_ExtentX = 19394
_ExtentY = 1349
ButtonWidth = 979
ButtonHeight = 1191
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "设置"
Key = "setup"
ImageIndex = 5
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "打印"
ImageIndex = 4
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "Cancel"
ImageIndex = 2
EndProperty
EndProperty
BorderStyle = 1
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "所属单位汇总表"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 3960
TabIndex = 1
Top = 1080
Width = 4695
End
End
Attribute VB_Name = "Bb2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mycommand As New ADODB.Command
Dim myreder As New ADODB.Recordset
Dim mycommand1 As New ADODB.Command
Dim myreder1 As New ADODB.Recordset
Public strtable As String
Sub AddGrid()
Dim bm As String
sqlconn_open
mycommand.ActiveConnection = sqlconn
mycommand1.ActiveConnection = sqlconn
mycommand1.CommandType = adCmdText
mycommand.CommandType = adCmdText
mycommand.CommandText = "select Bm, Name from " & strtable & " " & " order by bm"
Set myreder = mycommand.Execute
While Not myreder.EOF()
Grid.Row = Grid.Rows - 1
If Not IsNull(myreder.Fields(0).Value) Then
Grid.col = 0
Grid.CellAlignment = 0
Grid.Text = myreder.Fields(0).Value
bm = myreder.Fields(0)
End If
If Not IsNull(myreder.Fields(1).Value) Then
Grid.col = 1
Grid.CellAlignment = 1
Grid.Text = myreder.Fields(1).Value
End If
If strtable = "DwBmCode" Then
mycommand1.CommandText = "select count(*),sum(Je) from GyzcCare where CzFlag=1 and DwbmId like " & "'" & bm & "%" & "'"
Else
mycommand1.CommandText = "select count(*),sum(Je) from GyzcCare where CzFlag=1 and CodeId like " & "'" & bm & "%" & "'"
End If
Set myreder1 = mycommand1.Execute
If Not IsNull(myreder.Fields(0).Value) Then
Grid.col = 2
Grid.Text = myreder1.Fields(0).Value
End If
If Not IsNull(myreder1.Fields(1).Value) Then
Grid.col = 3
Grid.Text = myreder1.Fields(1).Value
End If
myreder.MoveNext
Grid.Rows = Grid.Rows + 1
Wend
mycommand1.CommandText = "select count(*),sum(Je) from GyzcCare where CzFlag=1 "
Set myreder1 = mycommand1.Execute
Grid.Row = Grid.Rows - 1
Grid.col = 0
Grid.Text = "合计:"
Grid.col = 2
If Not IsNull(myreder1.Fields(0).Value) Then
Grid.Text = myreder1.Fields(0).Value
End If
Grid.col = 3
If Not IsNull(myreder1.Fields(1).Value) Then
Grid.Text = myreder1.Fields(1).Value
End If
sqlconn.Close
End Sub
Sub Bt()
Grid.Row = 0
Grid.col = 0
Grid.Text = "编号"
Grid.col = 1
If strtable = "DwBmCode" Then
Grid.Text = "单位"
Else
Grid.Text = "类别"
End If
Grid.col = 2
Grid.Text = "卡片张数"
Grid.col = 3
Grid.Text = "金额"
Grid.ColWidth(0) = 1000
Grid.ColWidth(1) = 3000
Grid.ColWidth(2) = 2000
Grid.ColWidth(3) = 2000
For i = 0 To Grid.Cols - 1
Grid.col = i
Grid.ColAlignment = 1
Next
End Sub
Private Sub Form_Load()
Call Bt
Call AddGrid
End Sub
Private Sub Form_Resize()
Grid.Top = Label1.Top + Label1.Height
Grid.Left = Me.ScaleLeft
Grid.Width = Me.ScaleWidth
Grid.Height = Me.ScaleHeight - Grid.Top
P_N = "Bb2"
P_Bt = Label1.Caption
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If Button.Index = 1 Then
setup.Flags = &H40
setup.ShowPrinter
End If
If Button.Index = 2 Then
Me.Hide
Call paper.printing(Me.Grid)
paper.Show
End If
If Button.Index = 3 Then
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -