📄 frmstandardreport.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
Begin VB.Form frmStandardReport
Caption = "标准表查询"
ClientHeight = 5415
ClientLeft = 60
ClientTop = 345
ClientWidth = 8760
LinkTopic = "Form1"
LockControls = -1 'True
MDIChild = -1 'True
ScaleHeight = 5820
ScaleMode = 0 'User
ScaleWidth = 8880
Begin ComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 5
Top = 0
Width = 8760
_ExtentX = 15452
_ExtentY = 741
ButtonWidth = 635
ButtonHeight = 582
Appearance = 1
_Version = 327682
BorderStyle = 1
Begin VB.CommandButton cmdPrint
Caption = "打印(&P)"
Height = 300
Left = 4875
TabIndex = 10
Top = 45
Width = 1170
End
Begin VB.CommandButton cmdSave
Caption = "报表保存(&M)"
Height = 300
Left = 3705
TabIndex = 9
Top = 45
Width = 1170
End
Begin VB.CommandButton cmdHide
Caption = "隐藏标题(&H)"
Height = 300
Left = 2460
TabIndex = 8
Top = 45
Width = 1170
End
Begin VB.CommandButton cmdFormatSet
Caption = "显示格式(&F)"
Height = 300
Left = 1290
TabIndex = 7
Top = 45
Width = 1170
End
Begin VB.CommandButton cmdAccSet
Caption = "报表设置(&S)"
Height = 300
Left = 45
TabIndex = 6
Top = 45
Width = 1170
End
End
Begin VB.PictureBox picAccount
Appearance = 0 'Flat
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 4815
Left = 60
ScaleHeight = 4785
ScaleWidth = 8565
TabIndex = 0
Top = 480
Width = 8595
Begin MSFlexGridLib.MSFlexGrid msgAccount
Bindings = "frmStandardReport.frx":0000
Height = 3675
Left = 180
TabIndex = 2
Top = 900
Width = 8175
_ExtentX = 14420
_ExtentY = 6482
_Version = 65541
Rows = 14
Cols = 14
FixedRows = 0
BackColor = -2147483639
ForeColor = -2147483630
BackColorFixed = -2147483628
ForeColorSel = -2147483643
BackColorBkg = -2147483628
GridLinesFixed = 1
AllowUserResizing= 1
Appearance = 0
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 2400
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 2400
Visible = 0 'False
Width = 2415
End
Begin MSFlexGridLib.MSFlexGrid msgTitle
Height = 855
Left = 180
TabIndex = 1
Top = 420
Width = 8175
_ExtentX = 14420
_ExtentY = 1508
_Version = 65541
Rows = 3
Cols = 9
FixedRows = 2
BackColor = -2147483628
ForeColor = -2147483630
BackColorFixed = -2147483628
BackColorBkg = -2147483628
WordWrap = -1 'True
AllowUserResizing= 1
Appearance = 0
End
Begin VB.Label LblTitle
AutoSize = -1 'True
BackColor = &H80000014&
Caption = "LblTitle"
Height = 180
Left = 3360
TabIndex = 3
Top = 60
Width = 720
End
End
Begin VB.Label LblShadow
BackColor = &H80000010&
Caption = "Label1"
Height = 4815
Left = 120
TabIndex = 4
Top = 540
Width = 8595
End
End
Attribute VB_Name = "frmStandardReport"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 标准表报表窗体
' 作者:邓强
' 日期:1998.06.26
'
' 根据用户选择标准表项目组织数据显示
' ShowAcntBook 显示数据(类模块StandardReportSet和Report模块调用)
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Const lngTitleHeight As Long = 450 '表头高度
Const lngTitleTop As Long = 350 '表头顶部位置
Const lngAccountTop As Long = 800 '表体顶部位置
'Const lngAccountHeight As Long = 3900 '表体高度
Const lngFormWidth As Long = 8500 '窗体最小宽度
Const lngFormHeight As Long = 5370 '窗体最小高度
Private WithEvents mclsMainControl As MainControl '主控对象
Attribute mclsMainControl.VB_VarHelpID = -1
Private mblnHaveHead As Boolean '是否需要标题
Private WithEvents mclsHook As Hook
Attribute mclsHook.VB_VarHelpID = -1
Private mOldCol As Integer
Private mintAddTail As Integer '在表格尾部添加的行数,用来控制查找循环的结束
Private mclsStandard As StandardReportSet '标准表设置对象
Private mclsFormCond As FormCond
Private mintDate As Integer '日期列
Private mintDirection As Integer '借贷方向列
Private mintDescribe As Integer '摘要列
Private mintLend(2) As Integer '借方数量,金额,外币列
Private mintLoan(2) As Integer '贷方数量,金额,外币列
Private mintBalance(2) As Integer '余额数量,金额,外币列
Private mintMastDealRow As Integer '已进行格式数据处理的最大行
Private mstrOtherCond As String '附加条件
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 数据标志: "#" 原始绑定数据,"$" 分组汇总数据,"~" 最后一行
' 位置:表格的第一固定列(已被隐藏)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 响应消息
Public Sub ResponseMessage()
Dim vntMessage As Variant
For Each vntMessage In mclsMainControl.Messages
Select Case vntMessage
' 单位 部门 科目 摘要
Case Message.msgCustomer, Message.msgDepartment, Message.msgAccount, Message.msgRemark
RefreshData
Case Else
End Select
Next
mclsMainControl.Messages.Clear
End Sub
'显示报表
Public Sub ShowAcntBook(ByVal lngReportId As Long, ByVal ViewId As Long, Optional clsReportSet As StandardReportSet, _
Optional clsFormCond As FormCond, Optional strOtherCond As String)
mstrOtherCond = strOtherCond
'显示已存盘的帐表
If clsReportSet Is Nothing Then
Set mclsStandard = New StandardReportSet
Set mclsFormCond = New FormCond
mclsFormCond.InitCondArr lngReportId, ViewId, 2
mclsStandard.GetReportSet (lngReportId)
'显示才由向导生成的帐表
Else
Set mclsStandard = clsReportSet
Set mclsFormCond = clsFormCond
End If
Set mclsMainControl = gclsSys.MainControls.Add(Me)
RefreshData
End Sub
Private Sub cmdAccSet_Click()
Dim blnIsOK As Boolean
blnIsOK = mclsStandard.ShowWizard(, mclsStandard.ParentId, mclsStandard.Level, mclsFormCond, False)
If blnIsOK Then RefreshData
End Sub
Private Sub cmdFormatSet_Click()
Dim blnIsOK As Boolean
blnIsOK = frmFormat.SetFormat(mclsStandard)
If blnIsOK Then RefreshData
End Sub
'涮新数据
Public Sub RefreshData()
Dim intRow As Integer
Dim Strsql As String, strWhere As String
Dim rstTemp As Recordset
msgAccount.FixedCols = 1
strWhere = mclsFormCond.GetCond
If strWhere <> "" Then
If mstrOtherCond <> "" Then strWhere = strWhere & " And " & mstrOtherCond
Else
If mstrOtherCond <> "" Then strWhere = mstrOtherCond
End If
If strWhere <> "" Then
Strsql = mclsStandard.GetSQLPre & " WHERE " & strWhere & Space(1) & mclsStandard.GetSQLLast
Else
Strsql = mclsStandard.GetSQLPre & Space(1) & mclsStandard.GetSQLLast
End If
Set rstTemp = gclsBase.BaseDB.OpenRecordset(Strsql, dbOpenSnapshot)
Set Data1.Recordset = rstTemp
If rstTemp.RecordCount = 0 Then
' msgAccount.AddItem ""
' msgAccount.TextMatrix(0, 0) = "#"
Else
For intRow = 0 To rstTemp.RecordCount - 1
msgAccount.TextMatrix(intRow, 0) = "#"
Next intRow
End If
InitGridRowCol
InitGridTitle
GetLoc
' GetBeginBalance '得到期初余额
DealBalance '处理余额
DealGroupSum '处理分组汇总数据
DealOnlySum mclsStandard.IsOnlyShowSum '处理只显示汇总数据
mintMastDealRow = 0
DealFormat '处理数据格式
Caption = "标准表查询" & " - " & mclsStandard.ReportName
LblTitle = mclsStandard.ReportName
LblTitle.Left = (msgAccount.Width - LblTitle.Width) \ 2
rstTemp.Close
End Sub
Private Sub cmdSave_Click()
Dim mblnIsOk As Boolean
mblnIsOk = mclsStandard.SaveStandard
If mblnIsOk Then
mclsFormCond.KeyID = mclsStandard.ReportID
mclsFormCond.UpdateCond
Caption = "标准表查询" & " - " & mclsStandard.ReportName
LblTitle.Caption = mclsStandard.ReportName
LblTitle.Left = (msgAccount.Width - LblTitle.Width) \ 2
End If
End Sub
Private Sub Form_Activate()
CallReportPopMenu
End Sub
Private Sub Form_Load()
mblnHaveHead = True
'设置钩子对象
Set mclsHook = New Hook
mclsHook.SetHook msgTitle.hwnd
' CallReportPopMenu
End Sub
'设置表头
Private Sub InitGridTitle()
Dim intCount As Integer
Dim intCol As Integer
LblTitle = mclsStandard.ReportName
Caption = mclsStandard.ReportName
With msgTitle
.Redraw = False
intCol = 1
For intCount = 0 To mclsStandard.Columns - 1
.TextMatrix(0, intCol) = mclsStandard.ColumnDesc(intCount)
.ColWidth(intCol) = mclsStandard.ColumnWidth(intCount)
msgAccount.ColWidth(intCol) = mclsStandard.ColumnWidth(intCount)
intCol = intCol + 1
Next intCount
.MergeCells = 1
For intCount = 0 To .Cols - 1
.FixedAlignment(intCount) = 4
.MergeCol(intCount) = True
Next intCount
For intCount = 0 To 1
.MergeRow(intCount) = True
Next intCount
.Redraw = True
End With
With msgAccount
.Redraw = False
.MergeCells = flexMergeRestrictColumns
For intCount = 1 To mclsStandard.GroupColumns + 1
.MergeCol(intCount) = True
Next intCount
.Redraw = True
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -