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

Passing parameters fromStored Procedure to CR

Status
Not open for further replies.

mnasuto

Technical User
Oct 22, 2001
87
GB
Hi,

I am using CR8 and SQL database.

I created report base on the Stored Procedure with parameter: Client_ID.
When I run report in CR I get prompt only for one value of Client_ID.
I need to be able to choose one, few, or all Client_ID.

I have to use parameters from Stored Procedure, not from report, as I have to create nice boxes in ASP for users to choose Clients.

So Crystal can see only one value of parameter from sotred procedure.How I can change StoredProcedure to overcome that problem?

Please help if you can.

My relevant part of SP:

CREATE PROCEDURE dbo.sp_R_KPI (@User_ID int)

AS SELECT not relevant

WHERE (dbo.tbl_Prog.User_ID = @User_ID)
GO

Best,
Marta
 
I believe that your issue is SQL Server related, not Crystal. How to pass a variable number of parameters to a stored procedure. Perhaps ask in the SQL Server forum.

One thing you can do is pass a string variable that contains one or more user_id values. Then use build a SQL statement inside of the stored procedure:

SELECT f1, f2 FROM t1 WHERE f3 IN (Your string variable)

You would need to use EXEC in the stored procedure to execute this new SQL statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top