📄 xsfx.frm
字号:
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H00FFFFFF&
Height = 7335
Left = 240
ScaleHeight = 7284
ScaleWidth = 11544
TabIndex = 18
Top = 0
Visible = 0 'False
Width = 11595
Begin VB.VScrollBar VScroll1
Height = 6735
Left = 11400
TabIndex = 22
Top = 0
Width = 255
End
Begin VB.HScrollBar HScroll1
Height = 375
Left = 0
TabIndex = 20
Top = 7800
Width = 11175
End
End
Begin VB.Menu print
Caption = "打印"
Begin VB.Menu mnuPreview
Caption = "预览"
End
Begin VB.Menu mnuPrint
Caption = "打印"
End
Begin VB.Menu null
Caption = "-"
End
Begin VB.Menu mnuManual
Caption = "编码控制预览"
Begin VB.Menu mnuPageUp
Caption = "上页"
End
Begin VB.Menu mnuPageDown
Caption = "下页"
End
Begin VB.Menu mnuZoom
Caption = "显示比例"
End
Begin VB.Menu mnuPaperSize
Caption = "选择纸张"
End
Begin VB.Menu mnuOrientation
Caption = "纸张方向"
End
End
Begin VB.Menu null1
Caption = "-"
End
Begin VB.Menu mnuExit
Caption = "关闭"
End
End
Begin VB.Menu shitu
Caption = "视图"
Begin VB.Menu fangda
Caption = "放大"
End
Begin VB.Menu suoxiao
Caption = "缩小"
End
End
Begin VB.Menu mnutjfx
Caption = "统计分析"
Begin VB.Menu fxtj
Caption = "分析条件"
End
Begin VB.Menu null2
Caption = "-"
End
Begin VB.Menu mnupic
Caption = "图表显示"
End
Begin VB.Menu mnufile
Caption = "文档显示"
End
End
Begin VB.Menu hlp
Caption = "帮助"
Begin VB.Menu about
Caption = "关于"
End
Begin VB.Menu neirong
Caption = "内容"
End
End
Begin VB.Menu quit
Caption = "退出"
Begin VB.Menu exit
Caption = "退出"
End
End
End
Attribute VB_Name = "xsfx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
Option Explicit
Dim tjsj As Integer
Dim xianshi As Integer
Private Values() As Variant
Private NumPoints As Integer
Dim listindex1, listindex2
Dim ljz
Dim titll
'##################################################################
'## 过程名称:loaddata
'## 参数: 无
'##################################################################
Private Sub loaddata()
On Error Resume Next
Adodc1.refresh
Dim dbname As String
Dim i As Integer
'Adodc1.Refresh
NumPoints = Adodc1.Recordset.RecordCount
ReDim Values(0 To NumPoints + 1, 0 To 2)
ljz = 0
Adodc1.Recordset.MoveFirst
For i = 1 To NumPoints
Values(i, 1) = Adodc1.Recordset.Fields(1)
Values(i, 2) = Abs(Adodc1.Recordset.Fields(0))
ljz = ljz + Abs(Adodc1.Recordset.Fields(0))
Adodc1.Recordset.MoveNext
Next i
Values(0, 1) = "总销量"
Values(0, 2) = ljz
Adodc1.Recordset.Close
End Sub
'##################################################################
'## 过程名称:exit_Click
'## 参数: 无
'##################################################################
Private Sub exit_Click()
Unload Me
End Sub
'##################################################################
'## 过程名称:fangda_Click
'## 参数: 无
'##################################################################
Private Sub fangda_Click()
Select Case xianshi
Case 1
Me.Chart1.Width = Me.Chart1.Width * 1.2
Clipboard.Clear
Me.Chart1.EditCopy
Me.Picture3.Width = Me.Chart1.Width + 200
Me.Picture3.Height = Me.Chart1.Height + 100
Me.Picture3.Picture = Clipboard.GetData()
Case 2
Me.Picture1.Width = Me.Picture1.Width * 1.2
Me.Picture1.Height = Me.Picture1.Height * 1.2
End Select
End Sub
'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
'##################################################################
Private Sub Form_Load()
Const MAKING_DATA = False
Dim jj
Dim llen
Adodc1.ConnectionString = connetstr
Adodc2.ConnectionString = connetstr
Adodc3.ConnectionString = connetstr
Adodc3.refresh
llen = Adodc3.Recordset.RecordCount
For jj = 0 To llen - 1
List1.AddItem Adodc3.Recordset.Fields(0)
Adodc3.Recordset.MoveNext
Next jj
Me.DTPicker1.Value = Now
'End If
End Sub
'##################################################################
'## 过程名称:Command5_Click
'## 参数: 无
'##################################################################
Private Sub Command5_Click()
On Error Resume Next
List2.AddItem List1.List(listindex1)
List1.RemoveItem listindex1
End Sub
'##################################################################
'## 过程名称:Command6_Click
'## 参数: 无
'##################################################################
'##################################################################
'## 过程名称:Command6_Click
'## 参数: 无
'##################################################################
Private Sub Command6_Click()
On Error Resume Next
Dim li
Dim jj
li = List1.ListCount
For jj = 1 To li
List2.AddItem List1.List(jj)
Next jj
End Sub
'##################################################################
'## 过程名称:Command7_Click
'## 参数: 无
'##################################################################
'##################################################################
'## 过程名称:Command7_Click
'## 参数: 无
'##################################################################
Private Sub Command7_Click()
On Error Resume Next
List1.AddItem List2.List(listindex2)
List2.RemoveItem listindex2
End Sub
'##################################################################
'## 过程名称:Command9_Click
'## 参数: 无
'##################################################################
'##################################################################
'## 过程名称:Command9_Click
'## 参数: 无
'##################################################################
Private Sub Command9_Click()
If Me.List2.ListCount <= 0 Then
Exit Sub
End If
Dim sql As String
Dim sj1, sj2 As String * 10
Dim li, jj
li = List2.ListCount
If li = 0 Then
sql = " "
Else
sql = "'"
For jj = 0 To li - 2
sql = sql & Trim(List2.List(jj)) & "','"
Next
sql = sql & Trim(List2.List(li - 1)) & "'"
End If
'按时间类型统计
Select Case tjsj
Case 1
sj1 = Format(DTPicker1.Value, "yyyy-mm-dd")
titll = Format(DTPicker1.Value, "yyyy年m月d日")
Case 2
sj1 = Format(DTPicker1.Value, "yyyy-mm")
titll = Format(DTPicker1.Value, "yyyy年m月")
Case 3
sj1 = Format(DTPicker1.Value, "yyyy")
titll = Format(DTPicker1.Value, "yyyy年")
End Select
titll = titll & "汽运销售分析图表"
Adodc1.RecordSource = " SELECT sum(" & jl_sqlstr & ".jz)/1000," & jl_sqlstr & ".hwm FROM " & jl_sqlstr & ",htk where " & jl_sqlstr & ".hth=htk.hth and htk.je<>0 and " & jl_sqlstr & ".sj like'%" & sj1 & "%' and " & jl_sqlstr & ".hwm in (" & sql & ") group BY " & jl_sqlstr & ".hwm "
Adodc1.refresh
'作图
loaddata
Me.Picture2.Visible = False
mnupic_Click
'MSHFlexGrid1.Refresh
' Me.Picture2.Visible = False
Me.Chart1.EditCopy
Me.Picture3.Picture = Clipboard.GetData(vbCFDIB)
End Sub
'##################################################################
'## 过程名称:fxtj_Click
'## 参数: 无
'##################################################################
Private Sub fxtj_Click()
Me.Picture2.Visible = True
Me.Picture1.Visible = False
Me.Chart1.Visible = False
End Sub
'##################################################################
'## 过程名称:HScroll1_Change
'## 参数: 无
'##################################################################
Private Sub HScroll1_Change()
Me.Picture4.Left = -HScroll1.Value
End Sub
'##################################################################
'## 过程名称:HScroll1_Scroll
'## 参数: 无
'##################################################################
Private Sub HScroll1_Scroll()
Me.Picture4.Left = -HScroll1.Value
End Sub
'##################################################################
'## 过程名称:List1_Click
'## 参数: 无
'##################################################################
Private Sub List1_Click()
listindex1 = List1.ListIndex
End Sub
'##################################################################
'## 过程名称:List2_Click
'## 参数: 无
'##################################################################
Private Sub List2_Click()
listindex2 = List2.ListIndex
End Sub
'##################################################################
'## 过程名称:mnufile_Click
'## 参数: 无
'##################################################################
Private Sub mnufile_Click()
xianshi = 2
Dim jj
'Me.Picture4.Height = 9000 + 400 * (NumPoints + 2)
Me.HScroll1.Max = Abs(Me.Picture4.Width - Me.Picture2.Width)
Me.VScroll1.Max = Abs(Me.Picture4.Height - Me.Picture2.Height)
Me.Picture4.Cls
Me.Picture2.Visible = False
Me.Picture1.Visible = True
Me.Chart1.Visible = False
Me.Picture4.CurrentX = 2000
Me.Picture4.CurrentY = 400
Me.Picture4.FontSize = 16
Me.Picture4.Print titll
Me.Picture4.CurrentX = 500
Me.Picture4.CurrentY = 900
Me.Picture4.Print "煤种"
Me.Picture4.CurrentX = 2500
Me.Picture4.CurrentY = 900
Me.Picture4.Print "销售量"
Me.Picture4.CurrentX = 4500
Me.Picture4.CurrentY = 900
Me.Picture4.Print "百分比"
For jj = 0 To NumPoints
Me.Picture4.CurrentX = 500
Me.Picture4.CurrentY = 900 + 400 * (jj + 1)
Me.Picture4.Print Values(jj, 1)
Me.Picture4.CurrentX = 2500
Me.Picture4.CurrentY = 900 + 400 * (jj + 1)
Me.Picture4.Print Values(jj, 2)
Me.Picture4.CurrentX = 4500
Me.Picture4.CurrentY = 900 + 400 * (jj + 1)
Me.Picture4.Print FormatPercent(Values(jj, 2) / ljz)
'* 100; "%"
Next jj
End Sub
'##################################################################
'## 过程名称:mnupic_Click
'## 参数: 无
'##################################################################
Private Sub mnupic_Click()
xianshi = 1
Me.Picture1.Visible = False
Me.Picture2.Visible = False
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -