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

📄 report3.frm

📁 学生管理系统,用VB开发的,若需要可提供相关论文
💻 FRM
字号:
VERSION 5.00
Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "crystl32.ocx"
Begin VB.Form report3 
   Caption         =   "家庭成员报表"
   ClientHeight    =   1845
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4980
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   1845
   ScaleWidth      =   4980
   StartUpPosition =   2  'CenterScreen
   Begin Crystal.CrystalReport cr2 
      Left            =   2760
      Top             =   0
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   262150
   End
   Begin VB.OptionButton Option2 
      Caption         =   "自定义类型"
      Height          =   495
      Left            =   720
      TabIndex        =   4
      Top             =   840
      Width           =   1455
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Excel类型"
      Height          =   495
      Left            =   720
      TabIndex        =   3
      Top             =   480
      Value           =   -1  'True
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Caption         =   "报表类型"
      Height          =   1215
      Left            =   360
      TabIndex        =   2
      Top             =   240
      Width           =   2535
   End
   Begin VB.CommandButton Command2 
      Caption         =   "关闭"
      Height          =   495
      Left            =   3240
      TabIndex        =   1
      Top             =   960
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开报表"
      Height          =   495
      Left            =   3240
      TabIndex        =   0
      Top             =   360
      Width           =   1455
   End
End
Attribute VB_Name = "report3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim exlapp As New Excel.Application
Dim exlbook As Excel.Workbook
Dim exlsheet As Excel.Worksheet
Dim rsfml As ADODB.Recordset

Private Sub Command1_Click()
If Option1.Value = True Then


Dim rows As Integer
rows = 2
  If rsfml.RecordCount > 0 Then
    While Not rsfml.EOF
      With exlapp.Sheets(1)
       For i = 0 To 7
        .Cells(rows, i + 1) = rsfml.Fields(i)
        Next i
      rsfml.MoveNext
      rows = rows + 1
     End With
    Wend
   exlapp.Visible = True
  Else
  MsgBox "database error!"
  End If
  
  
End If


If Option2.Value = True Then
With cr2
  .ReportFileName = "e:\fml.rpt"
  .Action = 1
  
  
End With
  'drp3.Visible = True
  
End If



End Sub

Private Sub Command2_Click()
Unload Me
frmmain.Visible = True
End Sub

Private Sub Form_Load()
Set exlapp = New Excel.Application
exlapp.Workbooks.Open "e:\man\fml.xlt"
Set rsfml = New ADODB.Recordset
rsfml.Open "select * from fml", cn, adOpenStatic, adLockOptimistic

End Sub

Private Sub Form_Unload(Cancel As Integer)
rsfml.Close
Set rsfml = Nothing
exlapp.quit
End Sub


Private Sub Option1_GotFocus()
Option1.Value = True

End Sub



Private Sub Option2_GotFocus()
Option2.Value = True

End Sub

⌨️ 快捷键说明

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