⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmstandardbook.frm

📁 金算盘软件代码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
    mblnRefresh = False
    mblnFatalErr = False
    mblnCrossSameWidth = True
    
    '初始化类
    If clsReportSet Is Nothing Then
        Set mclsStandard = New StandardReportSet
        blnLoad = mclsStandard.GetReportSet(lngReportID)
        If blnLoad = False Then
            Unload MsgForm
            Unload Me
            Exit Sub
        End If
    Else
        Set mclsStandard = clsReportSet
    End If
    If clsCross Is Nothing Then
        Set mclsCross = New CrossSet
        blnLoad = mclsCross.GetReportSet(lngReportID)
        If blnLoad = False Then
            Unload MsgForm
            Unload Me
            Exit Sub
        End If
    Else
        Set mclsCross = clsCross
    End If
    If clsFormCond Is Nothing Then
        Set mclsFormCond = New FormCond
        mclsFormCond.InitCondArr lngReportID, ViewId, 2, 64, "日期"
    Else
        Set mclsFormCond = clsFormCond
    End If
    
    
    Select Case mclsStandard.ViewId
    Case 593, 637    '工资报表
        If Val(mclsStandard.SalaryID) = 0 Then
            Unload MsgForm
            Utility.ShowMsg Me.hWnd, "请原谅:还没有发放工资,不能打开报表!", vbInformation + vbOKOnly, App.title
            Unload Me
            Exit Sub
        End If
        #If conHos = 0 Then
        Salary.UpdateSalary_lngPersonTaxID
        #End If
    Case 597
        #If conHos = 0 Then
        Salary.UpdateSalary_lngPersonTaxID
        #End If
    Case 591, 754, 774, 757, 775, 663, 664, 665, 1214, 1215 '固定资产
    Case 648, 649, 650, 1114, 1115, 1116       'WQ财务稽查
    Case Else
        Utility.InitDate cmbDate
        GetDateName str, strCap
        lblD.Tag = str
        lblD.Caption = strCap
    End Select
     
    Set mclsCell = New FreeCellSet
    mclsCell.ReportID = lngReportID
    mclsCell.ReportName = mclsStandard.ReportName
    mclsCell.DateCellInitNo = mclsStandard.ListColumns + 2
    mclsCell.LoadFreeCell
    
    Set mclsFset = New ClsFormatset
    mclsFset.InitPropertyByDataBase 3, mclsStandard.ReportID
    GetDefaultSet
    
    mlngCurPage = 1                                                              '设置当前页
    '设置GRID的TOP
    If mclsStandard.GridTop = 0 Then
        SetGridTop 90
    Else
        SetGridTop mclsStandard.GridTop / Screen.TwipsPerPixelY
    End If
    InitHeadList
    If mblnStandard Then
        mclsStandard.SetSQL
    End If
    mblnAutoRefresh = True
    RefreshData                                                                  '涮新数据
    mstrOldDate = detBegin.Text & "$" & detEnd.Text
    
    If mblnFatalErr Then
        Unload MsgForm
        Exit Sub
    End If
    ABook.FCLocked = 1
    StandardReport.AddHelpID Me, mclsStandard.GroupNo                            '加帮助ID
    Set mclsMainControl = gclsSys.MainControls.Add(Me)                           '加入主控
    Utility.LoadFormSetting Me
    mblnRefresh = True
    mblnLoaded = True
    Me.Show
        Exit Sub
ErrHandle:
    edtErrReturn = Errors.ErrorsDeal
    
    If edtErrReturn = edtResume Then
         Resume
    Else
         On Error Resume Next
         Unload MsgForm
         Unload Me
    End If
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                          *          控件事件处理              *
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''




Private Sub ABook_ColumnResize(col As Integer, ByVal width As Integer, bCancel As Integer)
'返回给类与GRID
    Dim intStart As Integer, intCol As Integer
    Dim lngFixedWidth As Long
    
    If mblnStandard Then
        If col = -1 Then
        ElseIf width >= ABook.ColCount Then
                Utility.ShowMsg Me.hWnd, "列太宽!", vbOKOnly + vbInformation, App.title
                bCancel = 1
                Exit Sub
        ElseIf mblnRotate Then
            If col < msgTitle.FixedRows Then
            '取固定列宽度(加一非固定列)
                lngFixedWidth = 0
                For intCol = 0 To msgTitle.FixedRows
                    lngFixedWidth = lngFixedWidth + msgTitle.RowHeight(intCol)
                Next intCol
                If lngFixedWidth > mlngPageWidth Then
                    Utility.ShowMsg Me.hWnd, "固定列太宽!", vbOKOnly + vbInformation, App.title
                    bCancel = 1
                    Exit Sub
                Else
                    msgTitle.RowHeight(col) = IIf(ABook.ColumnWidth(col) > 0, ABook.ColumnWidth(col), 0)
                End If
             Else
                msgAccount.RowHeight(col + 1 - msgTitle.FixedRows) = IIf(ABook.ColumnWidth(col) > 0, ABook.ColumnWidth(col), 0)
             End If
        Else    '正常显示
            If col < msgTitle.FixedCols - mbytExtraCols Then
                '取固定列宽度(加一非固定列)
                lngFixedWidth = 0
                For intCol = mbytExtraCols To msgTitle.FixedCols
                    lngFixedWidth = lngFixedWidth + msgTitle.ColWidth(intCol) / Screen.TwipsPerPixelX
                Next intCol
                intStart = 0
                '改变后列宽度
                lngFixedWidth = lngFixedWidth - msgTitle.ColWidth(intStart + col + 1) / Screen.TwipsPerPixelX + width
                If lngFixedWidth > mlngPageWidth Then
                    Utility.ShowMsg Me.hWnd, "固定列太宽!", vbOKOnly + vbInformation, App.title
                    bCancel = 1
                    Exit Sub
                End If
            Else
                intStart = mlngColStart(mlngCurPage - 1)
            End If
            msgTitle.ColWidth(intStart + col + mbytExtraCols) = IIf(width > 0, width * Screen.TwipsPerPixelX, 0)
            mclsStandard.ColumnWidth(mclsStandard.ChoosedLoc(intStart + col)) = msgTitle.ColWidth(intStart + col + mbytExtraCols)
        End If
    Else
        If col = -1 Then
        Else
            If width >= ABook.ColCount Then
                Utility.ShowMsg Me.hWnd, "列太宽!", vbOKOnly + vbInformation, App.title
                bCancel = 1
                Exit Sub
            End If
            If col < mclsCross.RowColumns Then
                '取固定列宽度
                lngFixedWidth = 0
                For intCol = 0 To mintFixedCols - 1 + mbytExtraCols
                    lngFixedWidth = lngFixedWidth + msgAccount.ColWidth(intCol) / Screen.TwipsPerPixelX
                Next intCol
                If mintFixedCols < msgAccount.Cols Then
                    lngFixedWidth = lngFixedWidth + msgAccount.ColWidth(mintFixedCols + mbytExtraCols) / Screen.TwipsPerPixelX
                End If
                intStart = 0
                lngFixedWidth = lngFixedWidth + width - msgAccount.ColWidth(intStart + col) / Screen.TwipsPerPixelX
                If lngFixedWidth > mlngPageWidth Then
                    Utility.ShowMsg Me.hWnd, "固定列太宽!", vbOKOnly, App.title
                    bCancel = 1
                    Exit Sub
                End If
                msgTitle.ColWidth(intStart + col + mbytExtraCols) = IIf(width > 0, width * Screen.TwipsPerPixelX, 0)
                mclsCross.ColumnWidth(mclsCross.RowLoc(col)) = msgTitle.ColWidth(intStart + col + mbytExtraCols)
            Else
                intStart = mlngColStart(mlngCurPage - 1)
                lngFixedWidth = IIf(width > 0, width * Screen.TwipsPerPixelX, 0)
                If mblnCrossSameWidth Then
                    mclsCross.DefWidth = lngFixedWidth
                    For intStart = mclsCross.RowColumns + mbytExtraCols To msgTitle.Cols - 1
                        If msgTitle.TextMatrix(2, intStart) <> "1" Then
                            msgTitle.ColWidth(intStart) = lngFixedWidth
                        End If
                    Next intStart
                Else
                    msgTitle.ColWidth(intStart + col) = lngFixedWidth
                End If
            End If
        End If
    End If
    
    bCancel = 0
    If DispartPage Then                                    '分页
        SetData                                        '填充数据
    End If
    mblnChanged = True
End Sub

Private Sub ABook_DbClick(Row As Integer)
Dim intRow As Integer, intType As Integer
Dim lngActivityID As Long
    On Error Resume Next
    If Not mblnStandard Then Exit Sub
    If mclsStandard.IsOnlyShowSum Then Exit Sub
    '对应GRID行
    intRow = Row + mlngRowStart(mlngCurPage - 1) - msgTitle.FixedRows
    If intRow > msgAccount.Rows - 1 Then Exit Sub
    If msgAccount.TextMatrix(intRow, 0) <> "#" Then Exit Sub
    intType = Val(GetNoXString(msgAccount.TextMatrix(intRow, 1), 1, "/"))
    lngActivityID = Val(GetNoXString(msgAccount.TextMatrix(intRow, 1), 2, "/"))
    If intType > 0 And lngActivityID > 0 Then
        BillPublic.ShowBill1 intType, lngActivityID
    End If
End Sub

Private Sub ABook_FCMouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
Dim intLists As Integer
Dim blnHead As Boolean

    If mblnStandard Then
        intLists = mclsStandard.ListColumns
    Else
        intLists = mclsCross.ListColumns
    End If
    
    If Button = vbRightButton Then
        mintFCIndex = Index
        If ABook.IsMultiSel Then       '如果表头栏目多选
            Report.FreeCellFatSet
        Else
'            blnHead = ABook.Postion(Index) - 1
'            If Index <= intLists + 1 Or mclsCell.IsDateCell(mintFCIndex) Then
'            Else
'                StandardReport.CallFreeCellMenu blnHead
'                PopupMenu frmMain.mnuListActivity
'            End If
        End If
    End If
End Sub


Private Sub ABook_FreeCellChanged(Index As Integer)
Dim intLoc As Integer, intAlign As Integer

    If ABook.FCPlace = 1 Then
        intAlign = ABook.FCAlignment(Index)
    Else
        intAlign = 255
    End If
    If mblnStandard Then
        With mclsStandard
            If Index = 0 Then
                .TitleHeight = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .TitleWidth = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .TitleLeft = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .TitleTop = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .TitleAlign = intAlign
            ElseIf Index = 1 Then
                .CondHeight = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .CondWidth = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .CondLeft = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .CondTop = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .CondAlign = intAlign
            ElseIf Index < .ListColumns + 2 Then
                '表头列表框栏目
                intLoc = .ColumnListLoc(Index - 2)
                .ColumnHeight(intLoc) = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .ColumnWidth(intLoc) = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .ColumnLeft(intLoc) = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .ColumnTop(intLoc) = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .ColumnAlign(intLoc) = intAlign
            Else
            '处理报表自由单元
                mclsCell.FindLoc Index, intLoc
                mclsCell.CellHeight(intLoc) = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                mclsCell.CellWidth(intLoc) = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                mclsCell.CellLeft(intLoc) = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                mclsCell.CellTop(intLoc) = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                mclsCell.CellAlign(intLoc) = intAlign
            End If
        End With
    Else
        With mclsCross
            If Index = 0 Then
                .TitleHeight = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .TitleWidth = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .TitleLeft = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .TitleTop = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .TitleAlign = intAlign
            ElseIf Index = 1 Then
                .CondHeight = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .CondWidth = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .CondLeft = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .CondTop = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .CondAlign = intAlign
            ElseIf Index < .ListColumns + 2 Then
                '表头列表框栏目
                intLoc = .ColumnListLoc(Index - 2)
                .ColumnHeight(intLoc) = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                .ColumnWidth(intLoc) = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                .ColumnLeft(intLoc) = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                .ColumnTop(intLoc) = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                .ColumnAlign(intLoc) = intAlign
            Else
            '处理报表自由单元
                mclsCell.FindLoc Index, intLoc
                mclsCell.CellHeight(intLoc) = ABook.FCHeight(Index) * Screen.TwipsPerPixelX
                mclsCell.CellWidth(intLoc) = ABook.FCWidth(Index) * Screen.TwipsPerPixelX
                mclsCell.CellLeft(intLoc) = ABook.FCLeft(Index) * Screen.TwipsPerPixelX
                mclsCell.CellTop(intLoc) = ABook.FCTop(Index) * Screen.TwipsPerPixelX
                mclsCell.CellAlign(intLoc) = intAlign
            End If
        End With
    End If
    mblnChanged = True
End Sub
Private Sub ReGetCellChanged()
Dim Index As Integer
    For Index = 0 To mclsCell.FreeCells + mclsStandard.ListColumns + 1
        ABook_FreeCellChanged Index
    Next Index
End Sub

Private Sub ABook_HFMouseUp(Button As Integer, Shift As Integer, x As Single, y As Single, pos As Integer)
Dim blnAddCell As Boolean

    If Button = vbRightButton Then

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -