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!

Parameter Values 2

Status
Not open for further replies.

Barbara265

Technical User
Oct 16, 2000
30
0
0
US
I have a report that uses a parameter field to allow the user to enter a company number to view data on any one of many companies that has data stored in a SQL database. I would like to be able to have the user enter more than one company number at a time in the parameter since there are users who need to see data from multiple companies in a single report.. I'm using Crystal 6.0 Professional. I know Crystal 7 allows for the use of mulitple values in a parameter. Does anyone know of a work around in Crystal 6?

Thanks,
Barb
 
Simply pass the different numbers in a string with each number separated by commas. You then append a beginning and ending comma to the parameter so that it becomes ",123,456,789,". Then you convert the database value to a string and apply the commas to the beginning and end also, i.e., ",456,". Finally you see if the database string is contained in the modified parameter. The reason for the commas is so the user retrieves exact matches rather than partial matches.
 
You should also zero pad the strings to make them all the same length as the longest customer number. This is to ensure that if you have a customer 45 he doesn't show up when you are looking for 6457. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
I appreciate each of your suggestions. Unfortunately I'm not sure how to implement what Ron suggests. I've used parameters before, but I'm not familiar with the details of what he has suggested.

Thanks.
 
Is your parameter a numeric parameter?
Is your database field a true numeric field? Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
The parameter is based on a string field. EBase.EbPSID is the field where company designations (company 'number' if you will) are stored and is designated as text within SQL Server.
 
Since you are dealing with strings you have it easier. Have the user enter their company IDs in a string separated by commas. Then use the following record selection formula:

{EBase.EbPSID} in {?YourParamField} Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
<laughs> I submitted the first post and got an error saying my post was rejected... So I submitted it again... and voila! two posts. Sheesh, technology... It's been one of those days for sure. I do appreciate you taking the time to help though and I can say that once or twice and mean it!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top