> Dim crxApplication As New CRAXDRT.Application > Public oReport As CRAXDRT.Report > Public cboRpt1 > Public cboRpt2 > Public start_date > Public end_date > > 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:\crystal_test.rpt", 1) > oReport.SetParameterValue("ParamName1", start_date) > oReport.SetParameterValue("ParamName2", end_date) > ElseIf cboRpt1 = 0 And cboRpt2 = 1 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > oReport.SetParameterValue("ParamName1", start_date) > oReport.SetParameterValue("ParamName2", end_date) > ElseIf cboRpt1 = 0 And cboRpt2 = 2 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > oReport.SetParameterValue("ParamName1", start_date) > oReport.SetParameterValue("ParamName2", end_date) > ElseIf cboRpt1 = 1 And cboRpt2 = 0 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 1 And cboRpt2 = 1 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 1 And cboRpt2 = 2 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 1 And cboRpt2 = 3 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > oReport.SetParameterValue("ParamName1", start_date) > oReport.SetParameterValue("ParamName2", end_date) > ElseIf cboRpt1 = 1 And cboRpt2 = 4 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > oReport.SetParameterValue("ParamName1", start_date) > oReport.SetParameterValue("ParamName2", end_date) > ElseIf cboRpt1 = 2 And cboRpt2 = 0 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 2 And cboRpt2 = 1 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 2 And cboRpt2 = 2 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 2 And cboRpt2 = 3 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 2 And cboRpt2 = 4 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > ElseIf cboRpt1 = 2 And cboRpt2 = 5 Then > oReport = crxApplication.OpenReport("c:\crystal_test.rpt", 1) > End If > > crViewer.ReportSource = oReport > crViewer.ViewReport() > End Sub >