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

📄 formatsetclass.cls

📁 金算盘软件代码
💻 CLS
📖 第 1 页 / 共 3 页
字号:
    mblnVertCenter = vData
End Property

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get GStrHeader(ByVal i As Integer) As String
    GStrHeader = ReplaceString(Trim(mstrHeader(i)))
End Property

Public Property Get GStrHeaderOld(ByVal i As Integer) As String
    GStrHeaderOld = Trim(mstrHeader(i))
End Property
Public Property Let GStrHeader(ByVal i As Integer, ByVal vData As String)
    If vData = "" Then
        mstrHeader(i) = " "
    Else
        mstrHeader(i) = vData
    End If
End Property
Public Property Get GStrFooter(ByVal i As Integer) As String
    GStrFooter = ReplaceString(Trim(mstrFooter(i)))
End Property

Public Property Get GStrFooterOld(ByVal i As Integer) As String
    GStrFooterOld = Trim(mstrFooter(i))
End Property
Public Property Let GStrFooter(ByVal i As Integer, ByVal vData As String)
    If vData = "" Then
        mstrFooter(i) = " "
    Else
        mstrFooter(i) = vData
    End If
End Property
Public Property Get GBorderColor(ByVal i As Integer) As Long
    GBorderColor = mlngBorderColor(i)
End Property
Public Property Let GBorderColor(ByVal i As Integer, ByVal vData As Long)
    mlngBorderColor(i) = vData
End Property
Public Property Get GBorderWidth(ByVal i As Integer) As Integer
    GBorderWidth = mintBorderWidth(i)
End Property
Public Property Let GBorderWidth(ByVal i As Integer, ByVal vData As Integer)
    mintBorderWidth(i) = vData
End Property
Public Property Get GStyleOutFrame() As Integer
    GStyleOutFrame = mintFrameStyle
End Property
Public Property Let GStyleOutFrame(ByVal vData As Integer)
    mintFrameStyle = vData
End Property
Public Property Get GLineTypeOutframe() As Integer
    GLineTypeOutframe = mintFrameLine
End Property
Public Property Let GLineTypeOutframe(ByVal vData As Integer)
    mintFrameLine = vData
End Property

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get GSetupFont(ByVal i As Integer) As StdFont
    Set GSetupFont = mfntPropertiy(i)
End Property
Public Property Let GSetupFont(ByVal i As Integer, ByVal vData As StdFont)
    Set mfntPropertiy(i) = vData
End Property
Public Property Get GFontColor(ByVal i As Integer) As Long
    GFontColor = mlngFontColor(i)
End Property
Public Property Let GFontColor(ByVal i As Integer, ByVal vData As Long)
    mlngFontColor(i) = vData
End Property
Public Property Get GFontBackColor(ByVal i As Integer) As Long
    GFontBackColor = mlngFontBKColor(i)
End Property
Public Property Let GFontBackColor(ByVal i As Integer, ByVal vData As Long)
    mlngFontBKColor(i) = vData
End Property

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Property Get IsSaveToDB() As Boolean
    IsSaveToDB = mblnSaveToDB
End Property
Public Property Let IsSaveToDB(ByVal vData As Boolean)
    mblnSaveToDB = vData
End Property
Public Property Get GPaperTypeIndex() As Integer
'该属性提供给外部报表使用(即PaperSize属性)
    GPaperTypeIndex = mintPaperTypeIndex
End Property
Public Property Let GPaperTypeIndex(ByVal vData As Integer)
    mintPaperTypeIndex = vData
End Property
Public Property Get GPaperTypeIndex1() As Integer
    GPaperTypeIndex1 = mintPaperTypeIndex1
End Property
Public Property Let GPaperTypeIndex1(ByVal vData As Integer)
    mintPaperTypeIndex1 = vData
End Property


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                         公共方法
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'格式设置
Public Function ShowFrmFormatSet(ByVal intRowCount As Integer, ByVal intCurrenPageCode As Long, ByVal intTotalPage As Long, Optional ByVal lngHeaderHeight As Long = 0) As Boolean
Dim frm As New FrmFormatSet
    ShowFrmFormatSet = frm.ShowFrmFormatSet(Me, intRowCount, intCurrenPageCode, intTotalPage, lngHeaderHeight)
    If ShowFrmFormatSet And mblnSaveToDB Then    '如果有变化按了"确定"键,才执行回存数据库操作
        SaveToDateBase                           '把有关属性对象回存数据库
    End If
    Set frm = Nothing
End Function
'纸张设置
Public Function ShowPaperSet(Optional ByVal lngHeaderHeight As Long = 0) As Boolean
Dim frm As New FrmSetPaper
    ShowPaperSet = frm.ShowFrmSetPaper(Me, lngHeaderHeight)
    If ShowPaperSet And mblnSaveToDB Then        '如果有变化按了"确定"键,才执行回存数据库操作
        SavePaper                                '把有关纸张属性回存数据库
    End If
    Set frm = Nothing
End Function


Public Sub InitPropertyByDataBase(ByVal TypeIndex As Integer, Optional ByVal lngReportID As Long = 0, Optional ByVal lngSeriesPrintID As Long = 0, Optional ByVal blnDefaultSet As Boolean = False)
Dim strSQL As String, strTemp As String
Dim intLoc As Integer, intCount As Integer
Dim lngTempID As Long
Dim colFontID As New Collection
Dim rstInit As rdoResultset
    
    mintReportType = TypeIndex
    If lngReportID > 0 Then mlngReportID = lngReportID
    mlngSeriesPrintID = lngSeriesPrintID
    '找打印设置ID
    If lngSeriesPrintID > 0 Then   '根据套打ID找设置ID
        strSQL = "SELECT * FROM ReportPaper WHERE lngPaperID= " & mlngSeriesPrintID
        Set rstInit = gclsBase.BaseDB.OpenResultset(strSQL, rdOpenStatic)
        mlngPrintSetupID = rstInit!lngPrintSetupID
    Else
        strSQL = "SELECT * FROM Report WHERE lngReportID= " & mlngReportID
        Set rstInit = gclsBase.BaseDB.OpenResultset(strSQL, rdOpenStatic)
        mlngPrintSetupID = rstInit!lngPrintSetupID
    End If
    If mlngPrintSetupID = 0 Then
        mlngPrintSetupID = 60 + mintReportType   '取缺省打印设置ID
        mblnPreSet = True
    Else
        strSQL = "SELECT * FROM PrintSetup WHERE lngPrintSetupID= " & mlngPrintSetupID
        Set rstInit = gclsBase.BaseDB.OpenResultset(strSQL, rdOpenStatic)
        If rstInit.EOF Then
            mlngPrintSetupID = 60 + mintReportType   '取缺省打印设置ID
            mblnPreSet = True
        Else
            mblnPreSet = False
        End If
    End If
    
    If blnDefaultSet Then      '取缺省属性
        lngTempID = 60 + mintReportType          '取缺省打印设置ID
    Else
        lngTempID = mlngPrintSetupID
    End If
    '取格式设置属性
    On Error Resume Next
    strSQL = "SELECT * FROM PrintSetup WHERE lngPrintSetupID= " & lngTempID
    Set rstInit = gclsBase.BaseDB.OpenResultset(strSQL, rdOpenStatic)
    With rstInit
        mintZoomScale = !lngZoomScale
        mintPageZoom = !intPageZoomChoose
        mbytPageSetup = !intPageSetupType
        mlngHeightPerRow = !dblRowDistance * Screen.TwipsPerPixelY / 56.7
        mintRowsPerPage = !lngPaperRow - 3
        mblnNeedSeprateLine = !blnIsNeedSeprateLine
        mintLineSpace = !lngRowLine
        mblnFooterAlign = !blnIsFillEmptyRow
        
        mblnShowMoneyLine = !blnIsCashLine
        mblnShowNotZero = !blnIsShowZero
        mblnShowSeprate = !blnIsShowSeprate
        mintFormatNegative = !bytShowNegivate
        
        mintPaperIndex = !intPaperSizeIndex
        mintPaperTypeIndex1 = !lngPaperSize
        If !lngPaperSize = 0 Then  '表示为系统默认(该值要返回给外部报表)
            mintPaperTypeIndex = Printer.PaperSize
            mblnPortrait = IIf(Printer.Orientation = 1, True, False)
            mlngPaperHeight = Printer.Height / 5.67      '0.1毫米为单位
            mlngPaperWidth = Printer.width / 5.67
        Else
            mintPaperTypeIndex = !lngPaperSize
            Printer.Orientation = !lngOrientation
            If !lngOrientation = 1 Then '纵向
                mblnPortrait = True
                mlngPaperHeight = !lngPaperLength
                mlngPaperWidth = !lngPaperWidth
            Else     '横向
                mblnPortrait = False
                mlngPaperHeight = !lngPaperLength
                mlngPaperWidth = !lngPaperWidth
            End If
        End If
        
        mlngPaperBorder(0) = !dblTopMargin
        mlngPaperBorder(1) = !dblBottomMargin
        mlngPaperBorder(2) = !dblLeftMargin
        mlngPaperBorder(3) = !dblRightMargin
        mlngPaperBorder(4) = !dblHeaderMargin
        mlngPaperBorder(5) = !dblFooterMargin
        mlngPaperBorder(6) = !dblBindingMargin
        mintBindPosition = IIf(!blnIsUpBinding = 1, 1, 0)
        mblnHoriCentre = !blnIsHorizontalMiddle
        mblnVertCenter = !blnIsVerticalMiddle
           
        mstrHeader(0) = !strPageHeaderLeft
        mstrHeader(1) = !strPageHeaderMiddle
        mstrHeader(2) = !strPageHeaderRight
        mstrFooter(0) = !strPageFooterLeft
        mstrFooter(1) = !strPageFooterMiddle
        mstrFooter(2) = !strPageFooterRight
        mlngBorderColor(0) = !lngRowSeprateColor
        mlngBorderColor(1) = !lngColSeprateColor
        mlngBorderColor(2) = !lngOutFrameColor
        mintBorderWidth(0) = !intRowSeprateWidth
        mintBorderWidth(1) = !intColSeprateWidth
        mintBorderWidth(2) = !intOutFrameWidth
        mintFrameStyle = !intOutFrameStyle
        mintFrameLine = !intOutFrameLintType
        
        '字体属性
        mlngFontColor(0) = !lngTitleColor
        mlngFontColor(1) = !lngTextColor
        mlngFontColor(2) = !lngPageHFeaderColor
        mlngFontColor(3) = !lngTableHFooterColor
        mlngFontColor(4) = !lngColumnCaptionColor
        mlngFontBKColor(0) = !lngTitleBackColor
        mlngFontBKColor(1) = !lngTextBackColor
        mlngFontBKColor(2) = !lngPageHFeaderBackColor
        mlngFontBKColor(3) = !lngTableHFooterBackColor
        mlngFontBKColor(4) = !lngColumnCaptionBackColor
        mlngFontID(0) = !lngTitleFontID
        mlngFontID(1) = !lngTextFontID
        mlngFontID(2) = !lngPageHeaderFontID
        mlngFontID(3) = !lngTableHFooterFontID
        mlngFontID(4) = !lngColumnCaptionFontID

⌨️ 快捷键说明

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