home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form main
- AutoRedraw = -1 'True
- BackColor = &H00808000&
- Caption = "Crystal VBX Application"
- ClientHeight = 4770
- ClientLeft = 1125
- ClientTop = 1740
- ClientWidth = 8085
- ForeColor = &H00FF0000&
- Height = 5460
- Icon = MAIN.FRX:0000
- Left = 1065
- LinkTopic = "Form1"
- ScaleHeight = 4770
- ScaleWidth = 8085
- Top = 1110
- Width = 8205
- Begin CrystalReport Report1
- BoundReportFooter= 0 'False
- BoundReportHeading= ""
- Connect = ""
- CopiesToPrinter = 1
- Destination = 0 'Window
- DetailCopies = 1
- DiscardSavedData= 0 'False
- EMailCCList = ""
- EMailMessage = ""
- EMailSubject = ""
- EMailToList = ""
- EMailVIMBCCList = ""
- GroupSelectionFormula= ""
- Left = 7560
- MarginBottom = 0
- MarginLeft = 0
- MarginRight = 0
- MarginTop = 0
- PrinterCollation= 2 'default
- PrinterCopies = 1
- PrinterDriver = ""
- PrinterName = ""
- PrinterPort = ""
- PrinterStartPage= 0
- PrinterStopPage = 0
- PrintFileCharSepQuote= ""
- PrintFileCharSepSeparator= ""
- PrintFileName = ""
- PrintFileType = 2 'Text
- PrintFileUseRptDateFmt= 0 'False
- PrintFileUseRptNumberFmt= 0 'False
- ReportFileName = ""
- ReportSource = 0 'Report File
- ReportTitle = ""
- SelectionFormula= ""
- SessionHandle = 0
- SQLQuery = ""
- Top = 3720
- UserName = ""
- WindowBorderStyle= 2 'Sizable
- WindowControlBox= -1 'True
- WindowControls = -1 'True
- WindowHeight = 300
- WindowLeft = 100
- WindowMaxButton = -1 'True
- WindowMinButton = -1 'True
- WindowParentHandle= 0
- WindowState = 0 'normal
- WindowTitle = ""
- WindowTop = 100
- WindowWidth = 480
- End
- Begin CommonDialog CMDialog2
- Left = 7560
- Top = 2520
- End
- Begin PictureBox Picture1
- BackColor = &H00C0C000&
- FillColor = &H00C0C000&
- Height = 1215
- Left = 3600
- Picture = MAIN.FRX:0302
- ScaleHeight = 1185
- ScaleWidth = 1305
- TabIndex = 2
- Top = 1560
- Width = 1335
- End
- Begin SSPanel statusbar
- Align = 2 'Align Bottom
- Alignment = 1 'Left Justify - MIDDLE
- BackColor = &H00C0C0C0&
- BevelInner = 2 'Raised
- Caption = "Ready:"
- Font3D = 0 'None
- Height = 420
- Left = 0
- TabIndex = 1
- Top = 4350
- Width = 8085
- End
- Begin CommandButton Command1
- Caption = "Print Report"
- Height = 495
- Left = 3600
- TabIndex = 0
- Top = 3600
- Width = 1335
- End
- Begin CommonDialog CMDialog1
- Left = 7560
- Top = 3120
- End
- Begin Menu mnufilemain
- Caption = "&File"
- Begin Menu mnuOpenPrintJob
- Caption = "Open PrintJob"
- End
- Begin Menu mnuClosePrintJob
- Caption = "&Close PrintJob"
- End
- Begin Menu mnuseperate2
- Caption = "-"
- End
- Begin Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin Menu mnuDestination
- Caption = "&Destination"
- Begin Menu mnuOutPutToWindow
- Caption = "&Window"
- End
- Begin Menu mnuOutPutToPrinter
- Caption = "&Printer..."
- End
- Begin Menu mnuOutPutToFile
- Caption = "&Export To..."
- End
- End
- Begin Menu mnuOptions
- Caption = "&Options"
- Begin Menu mnuselectionformula
- Caption = "Formulas..."
- End
- Begin Menu mnuseperator4
- Caption = "-"
- End
- Begin Menu mnuSetSQL
- Caption = "Set SQL Query"
- End
- Begin Menu mnuaccess
- Caption = "Access Security..."
- End
- Begin Menu mnuNthTableLogOn
- Caption = "SQL Logon..."
- End
- Begin Menu mnustoredprocs
- Caption = "Stored Procedures..."
- End
- Begin Menu mnuseperator5
- Caption = "-"
- End
- Begin Menu mnudatabaselocation
- Caption = "Set Location..."
- End
- Begin Menu mnuGraphs
- Caption = "Graphing..."
- End
- Begin Menu mnusort
- Caption = "Sorting Functions..."
- Enabled = 0 'False
- End
- Begin Menu mnuseperator6
- Caption = "-"
- End
- Begin Menu mnuGroupSelection
- Caption = "Group Selection..."
- Enabled = 0 'False
- End
- Begin Menu mnuseperator7
- Caption = "Formating..."
- Enabled = 0 'False
- Begin Menu mnuPageMargins
- Caption = "Page Margins.."
- Enabled = 0 'False
- End
- End
- Begin Menu mnuseperator8
- Caption = "-"
- End
- Begin Menu mnuprintoptions
- Caption = "Set Print Options..."
- Enabled = 0 'False
- End
- End
- Begin Menu mnsHelp
- Caption = "&Help"
- Begin Menu mnuhelp
- Caption = "About VB Basic"
- End
- End
- Sub Command1_Click ()
- Dim StartPrintJob As Integer
- On Error GoTo ErrorMsg
- Screen.MousePointer = 11 ' Change the mouse to an hourglass
- report1.Action = 1 'Start the print Job
- Screen.MousePointer = 0 'Change mouse back to default
- Exit Sub
- 'If PeGetErrorCode(jobnumber) <> 0 Then
- ' result = MsgBox(GetErrorString(jobnumber), 0 + 48, "Print Engine Message")
- 'Display = MsgBox("Error:" & PEGetErrorCode(jobnumber)) 'This displays the error #
- 'End If
- ErrorMsg:
- infobox = MsgBox(report1.LastErrorString, 0 + 48, "VBX Error Message")
- Resume Next
- End Sub
- Sub Command2_Click ()
- End Sub
- Sub mnuaccess_Click ()
- accfrm.Show 1
- End Sub
- Sub mnuCloseEngine_Click ()
- If EngineOpened = 0 Then
- display = MsgBox("Engine Already Closed!", 0 + 48, "Engine Message")
- PeCloseEngine
- EngineOpened = 0
- display = MsgBox("Print Engine Closed!", 0 + 64, "Engine Message")
- End If
- End Sub
- Sub mnuClosePrintJob_Click ()
- report1.Action = 2
- statusbar.Caption = "Report Closed as Requested:"
- End Sub
- Sub mnudatabaselocation_Click ()
- setlocation.Show 1
- End Sub
- Sub mnuEngine_Click ()
- If peopenengine() = False Then
- MsgBox ("Engine Failed to open")
- MsgBox ("Engine Opened")
- End If
- End Sub
- Sub mnuExit_Click ()
- End
- End Sub
- Sub MnuExportTo_Click ()
- End Sub
- Sub mnufile2_Click ()
- End Sub
- Sub mnuGraphs_Click ()
- Graph.Show 1
- End Sub
- Sub mnuGroupSelection_Click ()
- groupselection.Show 1
- End Sub
- Sub mnuhelp_Click ()
- display = MsgBox("A Sample Visual Basic Application using the Crystal.VBX of Crystal Reports Version 4.0." + Chr$(10) + Chr$(10) + "Developed: 1995, Colin Brown, Crystal Services", 0 + 64, "VB Basic")
- End Sub
- Sub mnuNthTableLogOn_Click ()
- nthtablelogon.Show 1
- End Sub
- Sub mnuOpenEngine_Click ()
- If EngineOpened = 1 Then
- display = MsgBox("Engine Already Opened!", 0 + 48, "Engine Message")
- If peopenengine() = False Then 'Open Print Engine
- MsgBox ("Engine Failed to open")
- Else
- EngineOpened = 1 'Set Variable for PE Opened Pointer
- display = MsgBox("Print Engine Opened!", 0 + 64, "Engine Message")
- End If
- End If
- End Sub
- Sub mnuOpenPrintJob_Click ()
- Dim ErrorCode As Integer
- CMDialog1.Filter = "*.rpt files (*.rpt)|*.rpt|"
- CMDialog1.Action = 1
- reportname = CMDialog1.Filename
- Screen.MousePointer = 11
- report1.ReportFileName = reportname
- Screen.MousePointer = 1
- 'If jobnumber = False Then
- ' Statusbar.Caption = "Report file not opened!"
- 'MsgBox ("Cannot Read Report File! Error: " & PeGetErrorCode(jobnumber)), (16), ("Warning!")
- 'Else
- statusbar.Caption = "Report " + reportname + " Opened"
- 'mnuDestination = True 'Enable OutPut to Window Option
- 'End If
- End Sub
- Sub mnuOutPutToFile_Click ()
- Exportto.Show 1
- End Sub
- Sub mnuOutPutToPrinter_Click ()
- Cmdialog2.Action = 5
- Copies = Cmdialog2.Copies
- report1.PrinterCopies = Copies
- report1.Destination = 1
- MnuOutputToWindow.Checked = False
- MnuOutPutToPrinter.Checked = True
- MnuOutPutToFile.Checked = False
- statusbar.Caption = "Output Destination set for: Printer"
- End Sub
- Sub mnuOutPutToWindow_Click ()
- 'MsgBox ("Not Implemented Yet!")
- report1.Destination = 0 'Set output to window
- MnuOutputToWindow.Checked = True
- MnuOutPutToPrinter.Checked = False
- MnuOutPutToFile.Checked = False
- statusbar.Caption = "Output Destination set for: Window"
- End Sub
- Sub mnuPageMargins_Click ()
- margins.Show 1
- End Sub
- Sub mnuPrinter_Click ()
- End Sub
- Sub mnuprintoptions_Click ()
- printoptions.Show 1
- End Sub
- Sub mnuselectionformula_Click ()
- selectionformula.Show 1
- End Sub
- Sub mnuSetSQL_Click ()
- sqlquery.Show 1
- End Sub
- Sub mnusort_Click ()
- Sorting.Show 1
- End Sub
- Sub mnustoredprocs_Click ()
- storedprocs.Show 1
- End Sub
- Sub mnutest_Click ()
- margins.Show 1
- End Sub
-