📄 financereportwizard.frm
字号:
AddSortedColumns
End Sub
'设置栏目顺序(向上)
Private Sub cmdUpWard_Click()
Dim intTempIndex1 As Integer
Dim intTempIndex2 As Integer
Dim strTempText As String
intTempIndex1 = lstSelectedItem.ListIndex '当前所选项目的ListIndex
strTempText = lstSelectedItem.Text '当前项目的Text值
intTempIndex2 = lstSelectedItem.ListIndex - 1 '当前项目的前一个项目
lstSelectedItem.RemoveItem intTempIndex1
lstSelectedItem.AddItem strTempText, intTempIndex2
lstSelectedItem.ListIndex = lstSelectedItem.NewIndex
If lstSelectedItem.ListIndex = 0 Then
cmdUpWard.Enabled = False
End If
chkVertical.Value = 0
AddSortedColumns
End Sub
Private Sub comSortColumn_Click()
mclsFinanceRptWiz.SortColumnDesc = comSortColumn.ListIndex
End Sub
Private Sub Form_Activate()
If tabWizardPages.Tab = 0 Then
txtReportName.SetFocus
txtReportName.SelStart = 0
txtReportName.SelLength = Len(txtReportName.Text)
End If
End Sub
Private Sub Form_Load()
On Error GoTo ErrHandler
Dim intFixedCount As Integer
'初始化界面
mintTempMaxStep = mintMaxStep
If txtReportName <> "" Then
cmdNextStep.Enabled = True
Else
cmdNextStep.Enabled = False
End If
tabWizardPages.Tab = 0 '初始化页面 Tab = 0
loadResPic
'重新定义保存固定栏目的数组
ReDim strFixedColumnsString(intFixedColumns) As String
For intFixedCount = 0 To intFixedColumns
strFixedColumnsString(intFixedCount) = lstSelectedItem.list(intFixedCount)
Next
Set Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
'设置ListText的显示格式
lngChkOldTop = chkType(0).top
Exit Sub
Dim edtErrReturn As ErrDealType
ErrHandler:
edtErrReturn = Errors.ErrorsDeal
If edtErrReturn = edtResume Then
Resume
Else
On Error Resume Next
Unload MsgForm
Unload Me
End If
End Sub
Private Sub Form_Resize()
If Me.Height <> lngFormHeight Then
Me.Height = lngFormHeight
End If
If Me.width <> lngFormWidth Then
Me.width = lngFormWidth
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set mclsFinanceRptWiz = Nothing
Set mclsHook = Nothing
Set mclsFilter = Nothing
Erase strFixedColumnsString
Erase strSelected
UnloadResPic
mintStepNow = 0
mintTabIndex = 0
End Sub
Private Sub lstAll_Click()
'设置按钮 ToRight 的 Enabled 属性:只有选择一项后,才能有效
cmdToRight.Enabled = True
If lstAll.ListCount <= 0 Then
cmdToRight.Enabled = False
End If
End Sub
Private Sub lstAll_DblClick()
cmdToRight = True
End Sub
Private Sub lstSelectedItem_Click()
cmdToLeft.Enabled = True
If lstSelectedItem.ListIndex = 0 Then
cmdUpWard.Enabled = False
Else
cmdUpWard.Enabled = True
End If
If lstSelectedItem.ListIndex = lstSelectedItem.ListCount - 1 Then
cmdDownWard.Enabled = False
Else
cmdDownWard.Enabled = True
End If
End Sub
Private Sub lstSelectedItem_DblClick()
Dim blnIsIn As Boolean
Dim intFixedCount As Integer
For intFixedCount = 0 To intFixedColumns
If lstSelectedItem.Text = strFixedColumnsString(intFixedCount) Then
blnIsIn = True
Else
blnIsIn = False
End If
If blnIsIn = True Then
Exit For
End If
Next
If blnIsIn = False Then
cmdToLeft = True
Else
cmdToLeft = False
End If
If lstSelectedItem.ListCount <= 0 Then
cmdToLeft.Enabled = False
End If
End Sub
Private Sub optAnalyMethod_Click(Index As Integer)
mbytAnalyMethodId = Index
End Sub
Private Sub optDataSource_Click(Index As Integer)
optDataSource(Index).Value = True
If Not ((mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8) And mclsFinanceRptWiz.AccountStyle = 52) Then
bytDataSource = Index + 1
End If
If (mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8) And mclsFinanceRptWiz.AccountStyle = 52 Then
mbytAccountType = Index + 1
End If
If (mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8) And mclsFinanceRptWiz.AccountStyle = 52 Then
If Index >= 1 Then
chkType(1).Value = 0
chkType(2).Value = 0
chkType(1).Enabled = False
chkType(2).Enabled = False
If Index = 3 Or Index = 1 Then
chkIncludeUnPosted.Enabled = False
chkIncludeUnPosted.Value = 0
Else
chkIncludeUnPosted.Enabled = True
End If
Else
chkType(1).Enabled = True
chkType(2).Enabled = True
chkIncludeUnPosted.Enabled = True
End If
End If
End Sub
Private Sub optSortType_Click(Index As Integer)
mclsFinanceRptWiz.ColumnSortStyle = Index
End Sub
Private Sub tabWizardPages_Click(PreviousTab As Integer)
mlngStepNum = tabWizardPages.Tab + 1
If mlngStepNum > mintTempMaxStep Then
mlngStepNum = mintTempMaxStep
End If
If mlngStepNum = 2 Then
If txtReportName.Text = "" Then
ComEnabled
mlngStepNum = 1
ShowStep
cmdNextStep.Enabled = False
txtReportName.SetFocus
Exit Sub
End If
End If
If mlngStepNum > 2 Then
If CondIsValid = False Then
Exit Sub
End If
End If
ComEnabled
End Sub
Private Sub TxtFrom_KeyDown(KeyCode As Integer, Shift As Integer)
mclsFilter.TxtFrom_KeyDown Me, KeyCode, Shift
End Sub
Private Sub txtReportName_Change()
If Trim(txtReportName) <> "" Then
cmdNextStep.Enabled = True
Else
txtReportName.Text = Trim(txtReportName)
mlngStepNum = 1
ShowStep
ComEnabled
cmdNextStep.Enabled = False
End If
End Sub
Private Sub txtReportName_GotFocus()
txtReportName.SelStart = 0
txtReportName.SelLength = Len(txtReportName.Text)
End Sub
Private Sub txtReportName_LostFocus()
txtReportName = Trim(txtReportName)
End Sub
'计算数据类型的值(权值)
Private Function CountDatatype(Optional blnCheckedType As Boolean) As Byte
Dim intArrayIndex As Integer
Dim bytType As Byte
bytType = 0
If chkType(0) = 1 Then
bytType = bytType + 1
End If
If chkType(1) = 1 Then
bytType = bytType + 2
End If
If chkType(2) = 1 Then
bytType = bytType + 4
End If
If chkType(3) = 1 Then
bytType = bytType + 8
End If
If chkType(4) = 1 Then
bytType = bytType + 16
End If
If bytType = 0 Then
blnCheckedType = False
' bytType = 1
Else
blnCheckedType = True
End If
CountDatatype = bytType
End Function
'初始化数据来源和数据类型
Private Sub GetDataSource()
Dim rs As rdoResultset
Dim strSql As String
Dim bytDataTypes As Byte
Dim bytData(5) As Byte
Dim Index As Byte
Dim strAddedReferBEDate As String
Dim strTemp As String
bytData(0) = 1
bytData(1) = 2
bytData(2) = 4
bytData(3) = 8
bytData(4) = 16
bytData(5) = 32
cboCond.ListIndex = mclsFinanceRptWiz.CondShow
optSortType.Item(mclsFinanceRptWiz.ColumnSortStyle).Value = True
If mclsFinanceRptWiz.ReportIsFromWizard = False Then
Select Case mclsFinanceRptWiz.AccountTypeID
'财务状况分析表
Case 1, 2, 3, 55
strSql = "Select * From ReportAnalysisData Where ReportAnalysisData.lngReportID = " & mclsFinanceRptWiz.ReportID
Set rs = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
With rs
If .EOF = True Then
If mclsFinanceRptWiz.AccountTypeID <> 55 Then
optDataSource(0).Value = True
chkIncludeUnPosted.Value = 0
optAnalyMethod(0).Value = True
bytDataSource = 1
Else
optDataSource(2).Value = True
bytDataSource = 3
End If
Exit Sub
End If
If mclsFinanceRptWiz.AccountTypeID <> 55 Then
For Index = 0 To 2
bytDataTypes = bytData(Index) And !bytDataType
If bytDataTypes <> 0 Then
chkType(Index).Value = 1
Else
chkType(Index).Value = 0
End If
Next
bytDataSource = !bytDataSource
optDataSource(!bytDataSource - 1).Value = True
optAnalyMethod(!bytAccountType).Value = True
chkIncludeUnPosted.Value = !IncludeUnPosted
Else
bytDataSource = !bytDataSource
optDataSource(!bytDataSource - 1).Value = True
End If
.Close
End With
'采购,销售,库存,单价趋势
Case 5, 6, 7, 8, 12, 40, 41, 42, 43, 44, 45
strSql = "Select * From ReportAnalysisData Where ReportAnalysisData.lngReportID = " & mclsFinanceRptWiz.ReportID
Set rs = gclsBase.BaseDB.OpenResultset(strSql, rdOpenStatic)
With rs
If .EOF = True Then
For Index = 0 To 1
optDataSource(Index).Visible = False
Next
optDataSource(2).Value = True
optDataSource(2).Caption = "销售"
optDataSource(3).Caption = "采购"
optDataSource(4).Caption = "库存"
chkIncludeUnPosted.Value = 0
If mclsFinanceRptWiz.ViewId <> 306 And mclsFinanceRptWiz.ViewId <> 562 Then
chkIncludeUnPosted.Visible = True
End If
Exit Sub
End If
For Index = 0 To 4
bytDataTypes = bytData(Index) And !bytDataType
If bytDataTypes <> 0 Then
chkType(Index).Value = 1
Else
chkType(Index).Value = 0
End If
Next
For Index = 0 To 1
optDataSource(Index).Visible = False
Next
If Not ((mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8) And mclsFinanceRptWiz.AccountStyle = 52) Then
optDataSource(!bytDataSource - 1).Value = True
End If
If (mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8) And mclsFinanceRptWiz.AccountStyle = 52 Then
optDataSource(!bytAccountType - 1).Value = True
End If
optDataSource(2).Caption = "销售"
optDataSource(3).Caption = "采购"
optDataSource(4).Caption = "库存"
bytDataSource = !bytDataSource
If mclsFinanceRptWiz.AccountTypeID = 6 Or mclsFinanceRptWiz.AccountTypeID = 8 And mclsFinanceRptWiz.AccountStyle = 52 Then '销售分析
mbytAccountType = !bytAccountType
End If
chkIncludeUnPosted.Value = !IncludeUnPosted
.Close
End With
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -