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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports parameters from Visual Basic

Status
Not open for further replies.

paqguy

Instructor
Nov 1, 2001
36
0
0
US
I'm using the Crystal Report Control to open a report from Visual Basic. I can't find the help files for this and need to be able to pass a parameter to the report.

Any ideas? paqguy - Shaun Beane
Instructor/Developer
sbeane@adelphia.net
 
paqguy,
Try this...

Dim crpParamDef As CRAXDRT.ParameterFieldDefinition
Dim crpParamDefs As CRAXDRT.ParameterFieldDefinitions

'Open report for manipulation
Set crpReport = crpApplication.OpenReport(ReportFilename)

'Create a variable to relate to the report parameter fields
Set crpParamDefs = crpReport.ParameterFields

'Course through the parameter collection and set the values
'of the reports parameter fields.

For Each crpParamDef In crpParamDefs
With crpParamDef
Select Case .ParameterFieldName
Case "ParameterName1"'The name of parameter to pass.
.SetCurrentValue Value
Case "ParameterName2"'The name of parameter to pass.
.SetCurrentValue Value
'Case ... etc.
End Select

End With

Next

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top