Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass Start and End Date Parameter to Crystal Report
Message
General information
Forum:
ASP.NET
Category:
Reporting
Miscellaneous
Thread ID:
01029938
Message ID:
01541695
Views:
15
chek this link , it passes date paramters.

http://vb.net-informations.com/crystal-report/vb.net_crystal_report_parameter_date.htm

biki.

>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
>
Previous
Reply
Map
View

Click here to load this message in the networking platform