Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass Start and End Date Parameter to Crystal Report
Message
Information générale
Forum:
ASP.NET
Catégorie:
Rapports
Titre:
Pass Start and End Date Parameter to Crystal Report
Divers
Thread ID:
01029938
Message ID:
01029938
Vues:
206
Greetings from CyburrrrSpace!

I have a VB.NET form that previews a Crystal Report. For test purposes I am always using the same report with a start date and end date parameter.

I get this error when I run the following code and I don't know what is wrong. The error is as follows, followed by my code in VB.NET:

An unhandled exception of tpe "System.MissingMemberException" occurred in microsoft.visualbasic.dll.
Additional information: Public member "SetParameterValue" on type "ReportClass" not found.

Here is my code that generates this error. I was not getting any errors prior to adding the statement relative to start date and end date parameters.

THANKS FOR ALL OF YOUR HELP! I SINCERELY APPRECIATE YOU!
    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
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform