Public Class Form4 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button1 As System.Windows.Forms.Button Friend crViewer As CrystalActiveXReportViewerLib11.CrystalActiveXReportViewerClass Friend WithEvents AxCrystalActiveXReportViewer1 As AxCrystalActiveXReportViewerLib11.AxCrystalActiveXReportViewer <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form4)) Me.Button2 = New System.Windows.Forms.Button Me.Button1 = New System.Windows.Forms.Button Me.AxCrystalActiveXReportViewer1 = New AxCrystalActiveXReportViewerLib11.AxCrystalActiveXReportViewer CType(Me.AxCrystalActiveXReportViewer1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(415, 576) Me.Button2.Name = "Button2" Me.Button2.TabIndex = 7 Me.Button2.Text = "Continue" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(503, 576) Me.Button1.Name = "Button1" Me.Button1.TabIndex = 8 Me.Button1.Text = "Cancel" ' 'AxCrystalActiveXReportViewer1 ' Me.AxCrystalActiveXReportViewer1.Enabled = True Me.AxCrystalActiveXReportViewer1.Location = New System.Drawing.Point(16, 16) Me.AxCrystalActiveXReportViewer1.Name = "AxCrystalActiveXReportViewer1" Me.AxCrystalActiveXReportViewer1.OcxState = CType(resources.GetObject("AxCrystalActiveXReportViewer1.OcxState"), System.Windows.Forms.AxHost.State) Me.AxCrystalActiveXReportViewer1.Size = New System.Drawing.Size(960, 544) Me.AxCrystalActiveXReportViewer1.TabIndex = 9 ' 'Form4 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(992, 614) Me.Controls.Add(Me.AxCrystalActiveXReportViewer1) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.Button2) Me.Name = "Form4" Me.Text = "BayForce Technology Solutions" CType(Me.AxCrystalActiveXReportViewer1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region Dim crxApplication As New CRAXDRT.Application Public oReport As CRAXDRT.Report Public cboRpt1, cboRpt2 As String Public start_date, end_date As String Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If cboRpt1 = 0 And cboRpt2 = 0 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text)) oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text)) ElseIf cboRpt1 = 0 And cboRpt2 = 1 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text)) oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text)) ElseIf cboRpt1 = 0 And cboRpt2 = 2 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text)) oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text)) ElseIf cboRpt1 = 1 And cboRpt2 = 0 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 1 And cboRpt2 = 1 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 1 And cboRpt2 = 2 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 1 And cboRpt2 = 3 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text)) oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text)) ElseIf cboRpt1 = 1 And cboRpt2 = 4 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) oReport.ParameterFields.Item(1).AddCurrentValue(CDate(F1.TextBox2.Text)) oReport.ParameterFields.Item(2).AddCurrentValue(CDate(F1.TextBox3.Text)) ElseIf cboRpt1 = 2 And cboRpt2 = 0 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 2 And cboRpt2 = 1 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 2 And cboRpt2 = 2 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 2 And cboRpt2 = 3 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 2 And cboRpt2 = 4 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) ElseIf cboRpt1 = 2 And cboRpt2 = 5 Then oReport = crxApplication.OpenReport("C:\Documents and Settings\BayForce\My Documents\Crystal Reports\emsub.rpt", 1) End If crViewer.ReportSource = oReport crViewer.ViewReport() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Hide() F1.Show() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() End Sub End Class