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

RDC (CR 8.0), Pass parameter from VB6

Status
Not open for further replies.

zemp

Programmer
Joined
Jan 27, 2002
Messages
3,301
Location
CA
I need to be able to pass a parameter that a user will select in a VB6 app. I think that I need to do this in the Formatsection event of the section within which the parameter has been declared. Is this correct? If so do you know the correct syntax for this (only one parameter)? If I am heading in the wrong direction can you steer me towards the correct solution?

TIA

zemp
 
Assuming that you have defined your Report variable like this:

Dim Report As CRAXDRT.Report

You can define your parameter variable like this:

Dim crxParameterField As CRAXDRT.ParameterFieldDefinition

And then set the value in the VB code:

Set crxParameterField = Report.ParameterFields.Item(1)
crxParameterField.AddCurrentValue "your value here"

 
I am creating reports using multiple parameter fields.I want to delete parameter field at run time.But it is giving error that

"You are using an API that is not part of the free license agreement."

I have crystal report license for version 8.5.
How can I proceed?

 
adasoft

I used the code that balves suggested and I did not encounter any problems or errors. However I only used one parameter and I used it every time.

In order to run the same report without the parameter, I created another copy of the report that does not have a parameter. So really I have two reports in the app. The user will select to use a report for all data (no parameter) or a report on specific data (one parameter). This way I don't have to deal with deleteing or notusing a parameter. The user never notices that there are two reports. I use the VB code to determine which report to run.

Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top