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

📄 reportview.frm

📁 一个用VB6.0开发的简单餐会管理系统。在WIN2K
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form ReportView 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "报表"
   ClientHeight    =   3105
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   3105
   ScaleWidth      =   4680
   Begin VB.OptionButton Option1 
      Caption         =   "按社区排序"
      Height          =   375
      Index           =   1
      Left            =   120
      TabIndex        =   6
      Top             =   2760
      Width           =   1215
   End
   Begin VB.OptionButton Option1 
      Caption         =   "按生日排序"
      Height          =   375
      Index           =   0
      Left            =   120
      TabIndex        =   5
      Top             =   2520
      Width           =   1215
   End
   Begin VB.CommandButton Command3 
      Caption         =   "打印"
      Height          =   495
      Left            =   2520
      TabIndex        =   2
      Top             =   2520
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Caption         =   "确定"
      Height          =   495
      Left            =   1440
      TabIndex        =   1
      Top             =   2520
      Visible         =   0   'False
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退出"
      Height          =   495
      Left            =   3600
      TabIndex        =   0
      Top             =   2520
      Width           =   975
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   1335
      Left            =   120
      TabIndex        =   3
      Top             =   120
      Width           =   4335
      _ExtentX        =   7646
      _ExtentY        =   2355
      _Version        =   393216
      FixedCols       =   0
      Enabled         =   -1  'True
      FocusRect       =   0
      HighLight       =   0
      SelectionMode   =   1
      AllowUserResizing=   1
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   "D:\jp\vb\生日餐会系统\BSystem.mdb"
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   360
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   2040
      Width           =   1335
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Height          =   180
      Left            =   120
      TabIndex        =   4
      Top             =   1560
      Width           =   90
   End
End
Attribute VB_Name = "ReportView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''

'Private Const JP_SET_REPORT_BASE = 0            '报表类型
'Private Const JP_SET_REPORT_FBIR = 1


Dim flagReportView As Integer           '3为基本资料报表
                                        '4为完成生日餐会资料报表
'Dim MatrixMBView(2, JP_SET_MBVIEW_COLS) As Integer



Private Sub Command1_Click()
Unload Me
End Sub


Private Sub Command3_Click()
Me.MousePointer = vbHourglass


If flagReportView = JP_TX_ITEM3 Then
    PrinterYD MSFlexGrid1, JP_TX_ITEM3, Data1.Recordset.RecordCount
ElseIf flagReportView = JP_TX_ITEM4 Then
    PrinterYD MSFlexGrid1, JP_TX_ITEM4, Data1.Recordset.RecordCount
End If

Me.MousePointer = vbArrow
MsgBox JP_PRINT_FINISH, vbOKOnly
End Sub


Private Sub Form_Load()
ModifyReportView

InitReportData
InitChoiceReport
End Sub


Public Function ModifyReportView()
'''''''''''
''主框架
Me.Top = 0
Me.Left = 0
Me.Width = MainForm.Width - 200
Me.Height = MainForm.Height - 1000


''''''''''''
''MSFlexGrid1
MSFlexGrid1.Top = 100
MSFlexGrid1.Left = 100
MSFlexGrid1.Width = Me.Width - MSFlexGrid1.Left - 200
MSFlexGrid1.Height = Me.Height - MSFlexGrid1.Top - 1400


'''''''''''''
''button
Command1.Top = Me.Height - Me.Top - 1000
Command1.Left = Me.Width - Me.Left - Command1.Width - 200
Command3.Top = Command1.Top
Command3.Left = Command1.Left - Command2.Width - 200
Command2.Top = Command1.Top
Command2.Left = Command2.Left - Command3.Width - 200


''''''''''''
''label
Label1.Top = Command1.Top - 200
Label1.Left = MSFlexGrid1.Left

''''''''''''
''optionbutton
Option1(0).Top = Me.Height - Me.Top - 1000
Option1(0).Left = Me.Left + 200
Option1(1).Top = Option1(0).Top
Option1(1).Left = Me.Left + Option1(0).Width + 200

End Function

'''''''''''''''''
'''初始化数据库
Public Function InitReportData()
Data1.DatabaseName = App.Path & "\BSystem.mdb"


'''''''''''''
'''''optionbutton
ReportViewOptionFlag (False)
Option1(0).Value = True
Option1(1).Value = False
End Function

'''''''''''''''''
'''选择应该显示的报表
Private Function InitChoiceReport()

If SelRepForm.Option1(0) = True Then
    flagReportView = JP_TX_ITEM3
'    flagReportView = JP_SET_REPORT_BASE
    ReportViewOptionFlag (True)
    ModifyBASEReportView
    SetBASEReportView
ElseIf SelRepForm.Option1(1) = True Then
    flagReportView = JP_TX_ITEM4
    ReportViewOptionFlag (False)
'    flagReportView = JP_SET_REPORT_FBIR
    ModifyFBIRReportView
    SetFBIRReportView
End If

End Function

Private Sub Form_Unload(Cancel As Integer)
Data1.Database.Close
End Sub


'Private Function SetReportView()
'If flagReportView = JP_SET_REPORT_BASE Then
'    ModifyBASEReportView
'    SetBASEReportView
'ElseIf flagReportView = JP_SET_REPORT_FBIR Then
'    ModifyFBIRReportView
'    SetFBIRReportView
'End If
'End Function

'基本资料表
Private Function SetBASEReportView()
'编号、生日、姓名、年龄、性别、电话、参加生日餐会次数、阴历、地址、邮编、父、母、学校
Dim strSel As String
Dim SDate, EDate As Date    '开始、结束时间
Dim VMSDate, VMEDate, VDSDate, VDEDate As Integer '开始、结束月份值、开始、结束时间
'Dim sDays As Integer        '间隔时间
'Dim strDate As String       '日期
Dim i As Integer

'strSel = ViewForm.Text1.Text

'strSel = "Select * from 基本资料 where 日期 like '" & strSel & "*' order by 姓名 asc"
strSel = "SELECT 姓名,出生年月,性别,电话,参加次数,社区,地址,邮编,父,母 From 基本资料 "
strSel = strSel & "WHERE "
'得到时间
SDate = SelRepForm.DTPicker1.Value
EDate = SelRepForm.DTPicker2.Value

VMSDate = Month(SDate)
VMEDate = Month(EDate)
VDSDate = Day(SDate)
VDEDate = Day(EDate)

'sDays = EDate - SDate

If VMEDate > VMSDate Then
    For i = VMSDate To VMEDate
        If i = VMSDate Then
            strSel = strSel & "((Month(基本资料.出生年月) = " & i & " AND Day(基本资料.出生年月) >= " & VDSDate & ") "
        ElseIf i = VMEDate Then
            strSel = strSel & "Or (Month(基本资料.出生年月) = " & i & " AND Day(基本资料.出生年月) <= " & VDEDate & "))"
        Else

⌨️ 快捷键说明

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