Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing para

Status
Not open for further replies.

EscapeUK

Programmer
Jul 7, 2000
438
GB
How do i pass parameters from a vb app to a crystal report
 
What I put in below worked great for me. I had to cycle multiple command line options into parameters. Reply if you have any questions.

Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report

howManyParams = CrxRpt.ParameterFields.Count

Do While curparamline < howManyParams

curparamline = curparamline + 1

' This clears and sets the parameter field if String Type Parameter
If CrxRpt.ParameterFields(curparamline).ValueType = crStringField Then
CrxRpt.ParameterFields(curparamline).ClearCurrentValueAndRange
CrxRpt.ParameterFields(curparamline).AddCurrentValue (&quot;StringParameter&quot;)
End If

' This clears and sets the parameter field if Date Type Parameter
If CrxRpt.ParameterFields(curparamline).ValueType = crDateField Then
CrxRpt.ParameterFields(curparamline).ClearCurrentValueAndRange
CrxRpt.ParameterFields(curparamline).AddCurrentValue (DateValue(&quot;01/01/01&quot;))
End If

' This clears and sets the parameter field if DateTime Type Parameter
If CrxRpt.ParameterFields(curparamline).ValueType = crDateTimeField Then
CrxRpt.ParameterFields(curparamline).ClearCurrentValueAndRange
CrxRpt.ParameterFields(curparamline).AddCurrentValue (DateValue(&quot;01/01/01 09:00:00&quot;))
End If

Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top