📄 rtj.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form rtjb
Caption = "销售日报表"
ClientHeight = 7305
ClientLeft = 60
ClientTop = 450
ClientWidth = 8880
Icon = "rtj.frx":0000
LinkTopic = "日统计"
ScaleHeight = 7305
ScaleWidth = 8880
WindowState = 2 'Maximized
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "rtj.frx":0442
Height = 330
Left = 1680
TabIndex = 11
Top = 6480
Width = 1455
_ExtentX = 2566
_ExtentY = 582
_Version = 393216
ListField = "rm"
Text = "DataCombo1"
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 3600
Top = 6840
Visible = 0 'False
Width = 1335
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dzqch"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dzqch"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from ma where dw like '%重车%'"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text1
Height = 375
Left = 6120
TabIndex = 10
Top = 6480
Width = 2055
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Bindings = "rtj.frx":0457
Height = 4815
Left = 120
TabIndex = 6
Top = 1440
Width = 9375
_ExtentX = 16536
_ExtentY = 8493
_Version = 393216
Cols = 11
_NumberOfBands = 1
_Band(0).Cols = 11
_Band(0)._NumMapCols= 10
_Band(0)._MapCol(0)._Name= "发货单位"
_Band(0)._MapCol(0)._RSIndex= 0
_Band(0)._MapCol(1)._Name= "开票数量"
_Band(0)._MapCol(1)._RSIndex= 1
_Band(0)._MapCol(1)._Alignment= 7
_Band(0)._MapCol(2)._Name= "开票时间"
_Band(0)._MapCol(2)._RSIndex= 2
_Band(0)._MapCol(3)._Name= "煤种"
_Band(0)._MapCol(3)._RSIndex= 3
_Band(0)._MapCol(4)._Name= "今日发运量"
_Band(0)._MapCol(4)._RSIndex= 4
_Band(0)._MapCol(5)._Name= "累计发量"
_Band(0)._MapCol(5)._RSIndex= 5
_Band(0)._MapCol(5)._Alignment= 7
_Band(0)._MapCol(6)._Name= "欠存量"
_Band(0)._MapCol(6)._RSIndex= 6
_Band(0)._MapCol(6)._Alignment= 7
_Band(0)._MapCol(7)._Name= "到货地点"
_Band(0)._MapCol(7)._RSIndex= 7
_Band(0)._MapCol(8)._Name= "发货人"
_Band(0)._MapCol(8)._RSIndex= 8
_Band(0)._MapCol(9)._Name= "备注"
_Band(0)._MapCol(9)._RSIndex= 9
End
Begin VB.PictureBox Picture1
BackColor = &H00C0FFFF&
Height = 615
Left = 120
ScaleHeight = 555
ScaleWidth = 9315
TabIndex = 0
Top = 840
Width = 9375
Begin VB.CommandButton Command3
Caption = "退出"
Height = 300
Left = 7440
TabIndex = 7
Top = 120
Width = 972
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 300
Left = 4920
TabIndex = 3
Top = 120
Width = 972
End
Begin VB.CommandButton Command2
BackColor = &H00C0C0C0&
Caption = "打印"
Height = 300
Left = 6180
MaskColor = &H000000FF&
Style = 1 'Graphical
TabIndex = 2
Top = 120
UseMaskColor = -1 'True
Width = 972
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 2400
TabIndex = 1
Top = 40
Width = 1935
_ExtentX = 3413
_ExtentY = 661
_Version = 393216
Format = 19529728
UpDown = -1 'True
CurrentDate = 37506
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 1080
Top = 480
Visible = 0 'False
Width = 4455
_ExtentX = 7858
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dzqch"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dzqch"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"rtj.frx":046C
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
BackColor = &H00C0FFFF&
BackStyle = 0 'Transparent
Caption = "输入需统计的日期"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 4
Top = 120
Width = 2055
End
End
Begin VB.Label Label4
Caption = "本月累计"
Height = 255
Left = 4440
TabIndex = 9
Top = 6480
Width = 1335
End
Begin VB.Label Label3
Caption = "制表人"
Height = 375
Left = 600
TabIndex = 8
Top = 6480
Width = 855
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "销售日报表"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 240
TabIndex = 5
Top = 240
Width = 8415
End
End
Attribute VB_Name = "rtjb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
Dim sj1, sj2 As String * 10
Label2.Caption = jl_qym + Format(DTPicker1.Value, "yyyy年m月d日") & "销售日报表"
sj1 = Format(DTPicker1.Value, "yyyy-mm-dd")
'sj2 = Format(DTPicker2.Value, "yyyy-mm-dd")
MSHFlexGrid1.Refresh
'SELECT htk.fhdw AS 发货单位, htk.htl AS 开票数量, htk.sj AS 开票时间, htk.hwm AS 煤种, SUM(jlk.jz) AS 今日发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量, jlk.dhdd AS 到货地点, jlk.fhr AS 发货人, bz AS 备注 FROM jlk INNER JOIN htk ON jlk.hth = htk.hth GROUP BY jlk.dhdd,htk.bz,htk.fhdw, jlk.fhr, htk.hth, htk.htl, htk.hwm, htk.yfl, htk.wfl, htk.sj
Adodc1.RecordSource = " SELECT htk.fhdw AS 发货单位, htk.htl AS 开票数量,htk.sj AS 开票时间, htk.hwm AS 煤种, SUM(jlk.jz) AS 今日发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量,jlk.dhdd as 到货地点,jlk.fhr AS 发货人,bz as 备注 FROM jlk INNER JOIN htk ON htk.hth = jlk.hth where jlk.sj='" & sj1 & "' and jlk.hwm like '%煤%' group BY jlk.dhdd,htk.bz,htk.fhdw, jlk.fhr, htk.hth, htk.htl, htk.hwm, htk.yfl, htk.wfl, htk.sj"
Adodc1.Refresh
'Dim strQueryA As String
'SELECT jlk.fhr AS 货主姓名, htk.hth AS 发运票号, htk.htl AS 合同量, htk.hwm AS 煤种, SUM(jlk.jz) AS 今日发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量, htk.sj AS 开票时间, htk.fhdw AS 发货单位 FROM jlk INNER JOIN htk ON jlk.hth = htk.hth GROUP BY htk.fhdw,jlk.fhr, htk.hth,htk.htl, htk.hwm , htk.yfl, htk.wfl, htk.sj
' strQueryA = " SELECT htk.fhdw AS 发货单位, htk.htl AS 开票数量,htk.sj AS 开票时间, htk.hwm AS 煤种, SUM(jlk.jz) AS 今日发运量, htk.yfl AS 累计发量, htk.wfl AS 欠存量,jlk.dhdd as 到货地点,jlk.fhr AS 发货人,bz as 备注 FROM jlk INNER JOIN htk ON jlk.hth = htk.hth where jlk.sj='" & sj1 & "' and jlk.hwm like '%煤%' GROUP BY jlk.dhdd,htk.bz,htk.fhdw, jlk.fhr, htk.hth, htk.htl, htk.hwm, htk.yfl, htk.wfl, htk.sj"
' With DataEnvironment1.rsCommand2
' If .State = adStateOpen Then .Close
' .Source = strQueryA
' .Open '打开想输出的数据库数据项以便输出
'End With
MSHFlexGrid1.Refresh
End Sub
Private Sub Command2_Click()
On Error Resume Next
Dim fil As String
Dim xlapp As Object
Dim xlbook As Object
fil = App.Path & "\temp.xls"
If Dir(fil) <> "" Then
Kill fil
FileCopy App.Path & "\rbb.xls", fil
Else
FileCopy App.Path & "\rbb.xls", fil
End If
Dim xlsheet As Excel.Worksheet
Set xlapp = CreateObject("Excel.Application")
Set xlbook = GetObject(fil)
Set xlsheet = xlbook.Worksheets(1)
xlsheet.Cells(2, 8) = Label2.Caption
xlsheet.Cells(2, 8) = Format(DTPicker1.Value, "yyyy年m月d日")
For gm = 4 To Adodc1.Recordset.RecordCount + 4
xlsheet.Cells(Trim(Str(gm)), 1) = Adodc1.Recordset.Fields(0)
xlsheet.Cells(Trim(Str(gm)), 2) = Adodc1.Recordset.Fields(1)
xlsheet.Cells(Trim(Str(gm)), 3) = Adodc1.Recordset.Fields(2)
xlsheet.Cells(Trim(Str(gm)), 4) = Adodc1.Recordset.Fields(3)
xlsheet.Cells(Trim(Str(gm)), 5) = Adodc1.Recordset.Fields(4)
xlsheet.Cells(Trim(Str(gm)), 6) = Adodc1.Recordset.Fields(5)
xlsheet.Cells(Trim(Str(gm)), 7) = Adodc1.Recordset.Fields(6)
xlsheet.Cells(Trim(Str(gm)), 8) = Adodc1.Recordset.Fields(7)
xlsheet.Cells(Trim(Str(gm)), 9) = Adodc1.Recordset.Fields(8)
xlsheet.Cells(Trim(Str(gm)), 10) = Adodc1.Recordset.Fields(9)
xlsheet.Cells(Trim(Str(gm)), 11) = Adodc1.Recordset.Fields(10)
Adodc1.Recordset.MoveNext
Next
'xlsheet.Cells(18, 13) = Mid(m(13).text, 1, 8)
'xlsheet.Cells(18, 14) = Mid(n(13).text, 1, 8)
'xlsheet.Cells(18, 15) = Mid(o(13).text, 1, 8)
'xlsheet.Cells(18, 16) = Mid(p(13).text, 1, 8)
xlsheet.PrintOut
xlapp.Quit
Kill fil
Set xlbook = Nothing
Set xlapp = Nothing
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
MSHFlexGrid1.Rows = 30
DTPicker1.Value = Now
headle = 2
End Sub
Private Sub Form_Resize()
MSHFlexGrid1.Width = Me.Width - 400
MSHFlexGrid1.Height = Me.Height - 2800
Label2.Width = Me.Width
Picture1.Width = Me.Width - Picture1.Left * 2
End Sub
Private Sub Form_Unload(Cancel As Integer)
headle = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -