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!

How to pass an array to the Crystal report record selection formula

Status
Not open for further replies.

leaf3

Programmer
Nov 19, 2001
7
US
If several names from the name list box are selected how can I pass that many names to a record selection formula in Crystal Report? Thank You.
 
I need more information - are you using a stored procedure on your back end and reading the parameter as an array into Crystal? What datasource? What version of Crystal?
 
It is Crystal 6. I am not using a stored procedure. I just tried to pass an array to "CrystalReport1.SelectionFormula". Access is the datasource.
 
CR6 doesn't allow multiple parameters, but you could pass the 3 names as a single long string and then use:

{field} in "string"

As your selection formula.

Or you could build the following formula in VB as a string and pass it in as the selection formula:

{field} in ["name1","name2","name3"] Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken,

I am using Crystal 9.0 and I am wondering the same thing. I am not using a stored procedure in this case and I am wondering if I can pass an array to the selection expert. I would like to have the user select one or more values from a drop down, and from there take that value to the select expert and build up my criteria. Basically instead of using the IN clause that gets greated by the multi select of a drop down I want to be able to take the array and create AND statements with the values. Is this possible?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top