home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{00025600-0000-0000-C000-000000000046}#4.6#0"; "CRYSTL32.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Begin VB.Form flreport
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Dialog
- Caption = "Demo Report Selection"
- ClientHeight = 3960
- ClientLeft = 2505
- ClientTop = 2085
- ClientWidth = 6465
- ClipControls = 0 'False
- ControlBox = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3960
- ScaleWidth = 6465
- Begin ComctlLib.TreeView TreeView1
- Height = 3735
- Left = 120
- TabIndex = 6
- Top = 120
- Width = 4575
- _ExtentX = 8070
- _ExtentY = 6588
- _Version = 327680
- LabelEdit = 1
- Style = 5
- ImageList = "ImageList1"
- BorderStyle = 1
- Appearance = 1
- MouseIcon = "report.frx":0000
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 5760
- Top = 2640
- _ExtentX = 847
- _ExtentY = 847
- _Version = 327680
- End
- Begin VB.Frame Frame1
- Caption = "Display"
- Height = 975
- Left = 4920
- TabIndex = 3
- Top = 120
- Width = 1215
- Begin VB.OptionButton Window
- Caption = "Screen"
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 600
- Width = 975
- End
- Begin VB.OptionButton Printer
- Caption = "Printer"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 240
- Width = 975
- End
- End
- Begin VB.CommandButton But_setup
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Printer >>"
- Height = 375
- Left = 4920
- TabIndex = 2
- Top = 1680
- Width = 1095
- End
- Begin VB.CommandButton But_print
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "&Print"
- Height = 375
- Left = 4920
- TabIndex = 1
- Top = 1200
- Width = 1095
- End
- Begin VB.CommandButton But_close
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "&Close"
- Height = 375
- Left = 4920
- TabIndex = 0
- Top = 2160
- Width = 1095
- End
- Begin Crystal.CrystalReport Report1
- Left = 4920
- Top = 2760
- _ExtentX = 741
- _ExtentY = 741
- _Version = 262150
- WindowControlBox= -1 'True
- WindowMaxButton = -1 'True
- WindowMinButton = -1 'True
- WindowControls = -1 'True
- End
- Begin ComctlLib.ImageList ImageList1
- Left = 5160
- Top = 3240
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 15
- MaskColor = 12632256
- _Version = 327680
- BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
- NumListImages = 2
- BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "report.frx":001C
- Key = ""
- EndProperty
- BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
- Picture = "report.frx":01AE
- Key = ""
- EndProperty
- EndProperty
- End
- Attribute VB_Name = "flreport"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim i As Integer
- Dim reports(15) As String
- Dim MyNode As Node
- Dim Total_Reports As Integer
- Private Sub but_close_Click()
- Unload Me
- End Sub
- Private Sub but_print_Click()
- If reports(TreeView1.SelectedItem.Index) = "NA" _
- Or TreeView1.SelectedItem.Index = 1 Then
- MsgBox "You must first select a Report.", vbCritical, "Demo Message"
- Exit Sub
- End If
- On Error GoTo errorhandle
- Report1.SelectionFormula = ""
- Report1.ReportFileName = "C:\temp\" & reports(TreeView1.SelectedItem.Index) & ".rpt"
- For i = 0 To 15
- Report1.DataFiles(i) = ""
- Next i
- Report1.DataFiles(0) = "C:\program files\devstudio\vb\nwind.mdb"
- Report1.WindowTitle = "Demo Reporting"
- Report1.WindowMinButton = False
- If Window.Value Then
- Report1.Destination = 0
- Else
- Report1.Destination = 1
- End If
- Report1.Action = 1
- Exit Sub
- errorhandle:
- MsgBox "An error has occurred during Reporting with Error Number " & Err & Chr(13) & Error$, vbInformation, "Demo Message"
- Resume Next
- End Sub
- Private Sub But_setup_Click()
- CommonDialog1.Action = 5
- Report1.CopiesToPrinter = CommonDialog1.Copies
- End Sub
- Private Sub Form_Load()
- Window.Value = True
- But_print.Caption = "Display"
- Report1.WindowTitle = "Demo Reporting"
- Report1.WindowMinButton = False
- 'Initialize the TreeView Structure
- TreeView1.Nodes.Clear
- 'Set the Report List Header
- Set MyNode = TreeView1.Nodes.Add(, , "T", "Demo Crystal Reports Manager", 2)
- MyNode.EnsureVisible
- Total_Reports = 1
- 'Loop until there are no more reports to add
- 'Use an input file to hold the report names and levels
- For i = 2 To Total_Reports + 1
- 'Set the Report Names
- Set MyNode = TreeView1.Nodes.Add("T", tvwChild, "R1", "Crystal Report Demo Report", 1)
- reports(i) = "Chaptern"
- Next i
- End Sub
- Private Sub printer_Click()
- But_print.Caption = "Print"
- End Sub
- Private Sub Window_Click()
- But_print.Caption = "Display"
- End Sub
-