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!

Stored procedure - multiple parameter from crystal

Status
Not open for further replies.

Harki06

Technical User
May 18, 2006
85
US
Hi,

I am using Crystal 10 developer and enterprise. I am new to stored procedure and crystal combination. I managed to design a report and use the parameters passed from crystal to the stored procedure which is my data source successfully. One of the parameters needs to accept multiple choices i.e supplier names. How do I take care of this in the stored procedure?
 
I have a stored proc that does this.
This statement allows the parameter to accept multiple names, separated by commas, and eliminates any spaces the user may put behind a comma.
Can't gaurantee what it does with "O'Neil" though.

DECLARE @strUsername varchar(100)
set @strusername = 'john, joe'

SELECT *
FROM users
WHERE ',' + replace(@strusername, space(1), '') + ',' LIKE '%,' + RTRIM(first_name) + ',%'

 
So in Crystal, do you accept a parameter that can have multiple values in a dropdown?
 
What I've been doing is one text field in Crystal, letting the user put values in that text field separated by commas, and eliminating any spaces they may put in.
Ie. john, joe

 
That might be difficult in my case. The users would have to remember supplier names and will be resistant.
Sorry for the late response. I was on leave.
 
Hi Harki06...
I am also looking for a way to use combination of parameters,crystal reports and stored procedures.
In my case i need to pass some paramters to the stored procudure..I read ur post and understood that U already did that..
could u pls let me know how to pass parameters from crystal reports to the stored procedure..
I am using crystal reports stand alone..not integrated with visual studio..
 
Parameters in SPs are automatically configured within Crystal.

You need to write code to do this.

The nature of a SP parameter is to accept a single value, so Crystal sets up a single value for each, which is one reason why I often use Views.

There's occasional chatter by various database makers to create an array parameter, haven't seen it yet.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top