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

Passing Multiple Parameters

Status
Not open for further replies.

jemo

Programmer
Feb 9, 2001
8
CA
I am trying to pass through a parameter from VB6 to a Crystal Report, but the parameter has multiple values. (eg. The user wants to see a report on selected facilities) What is the syntax for doing this?
 
Try to concatanate all selected values into a single
String with a special delimiter between the values.

Then, within the report create a Selection Formula
that searches for Facility Code within the passed
parameter.

hth,
- Ido
 
I concatenated all the selected values into a string delimited by commas. In the crystal Report, there is a selection formula set up to look for the users.

The code I'm using to pass through the parameter to the report is:

.ParameterFields(0) = "Username;" & users & ";true"

where Username is a parameter set up in Crystal, and users is the concatenated field (asmith, bjones, etc)...

Could you help me with the syntax that I should be using, as this doesn't work?

Thanks

 
Please explain what you mean by "doesn't work".

Cheers,
- Ido
 
The report runs, but only the first name in the string gets selected for the criteria.

eg. is users = "jsmith, sthompson"

The report runs, but only the information of jsmith is printed.

Any thoughts?

Thanks
Jana
 
What is your Selection Criterion (and any related Formulas)?

Cheers,
- Ido
 
Sorry, I don't quite understand what you're asking for. In Crystal, the Parameter Username is set up, this is checked off to allow multiple values. In the
Selection Formula, this appears:

{@TheDate} in {?From Date} to {?To Date} and
{EDL_PERSON.PERSON_STATUS_ID} = "A" and
{WORK_DONE.CLASSUSER} in {?Username}

I was wrong in my last post....no records display at all when passing through the names as user1, user2, etc or user1 OR user2 OR user 3, etc.

Thanks
Jana
 
Jana,

You can't use the IN operator in this case.

Instead the condition should be something like

InStr({?Username}, {WORK_DONE.CLASSUSER})>0

Cheers,
- Ido
 
If I change the condition to the InStr(str1, str2), it won't allow the syntax and comes up with an error saying "a string should be here" and places the cursor in front of the {?Username} parameter.

Jana
 
What is the data type of the {?Username} parameter ?

It may be easier if we use direct communication.
Just send me an e-mail to: ixm7@psu.edu

Cheers,
- Ido
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top