Hi,
I have this code that passes 3 parameters to my report. I placed the parameter fields on the report so I can see that they do in fact get passed in.
I have a record selection in my Crystal Report that is based on the 3 parameters, it does not happen.
If I refresh the data, get the parameters dialog in Crystal and enter them manually it succeeds.
Why do the passed parameters not make a selection????
here is my VB6 code
here is my select statement copied from the select expert in CrystalXI, as I said the parameters appear in their fields on the page, so they are getting passed
I have this code that passes 3 parameters to my report. I placed the parameter fields on the report so I can see that they do in fact get passed in.
I have a record selection in my Crystal Report that is based on the 3 parameters, it does not happen.
If I refresh the data, get the parameters dialog in Crystal and enter them manually it succeeds.
Why do the passed parameters not make a selection????
here is my VB6 code
Code:
'set report location
Set report1 = crxApplication1.OpenReport("F:\test.rpt")
'logon
report1.Database.LogOnServer "p2sodbc.dll", "DSN", "database", "user", "password"
'loop through parameters and set
Dim CRXParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim CRXParamDef As CRAXDRT.ParameterFieldDefinition
Set CRXParamDefs = report1.ParameterFields
For Each CRXParamDef In CRXParamDefs
With CRXParamDef
Select Case .ParameterFieldName
Case "firstParam"
.ClearCurrentValueAndRange
.AddCurrentValue CInt(Text1.Text)
Case "secondParam"
.ClearCurrentValueAndRange
.AddCurrentValue "'" & Text2.Text & "'"
Case "thirdParam"
.ClearCurrentValueAndRange
.AddCurrentValue "'" & Text3.Text & "'"
End Select
End With
Next
report1.EnableParameterPrompting = False
here is my select statement copied from the select expert in CrystalXI, as I said the parameters appear in their fields on the page, so they are getting passed
Code:
{TestList.Job} = {?firstParam} and
{TestList.Company} = {?secondParam} and
{TestList.Project} = {?thirdParam}