In order for you to pass parameters into a stored procedure, you need to build the parameters into the procedure as opposed to building them in Crystal Reports. Furthermore, SQL doesn't allow multiple value parameters. You have a few options, but it depends on what you need to do:
- Why are you using a stored procedure?Is there something you're doing in the procedure that would be less efficient in a view, such as heavy data manipulation, creating/dropping temp tables, using cursors, etc..?
- If so, a procedure or a SQL command is probably the right data source.
- If your procedure could easily be converted into a view because you're not really using it to do any "heavy lifting", then it's probably the wrong data source. If you can use a view, you can use the Crystal Reports native multi-value parameter functionality.
- What version of Crystal Reports are you using?
- If you're using Crystal Reports 2008 and need the power of a procedure, I'd recommend converting the SQL to a SQL Command, since Crystal Reports 2008 allows you to use multi-value parameters against SQL Commands (Crystal basically built a front end to allow what is otherwise a SQL limitation)
- If you're using a prior version and need the power of a procedure, you can still create a multiple value param, but it's more complicated - you'd need to put the procedure into a subreport. You'd then create the multi-value parameter in the main report, collect the values into a string formula and then pass the result of the string formula to the subreport procedure parameter through the subreport links. Works well, but is complicated.





by: mlmccPosted on 2009-10-10 at 15:45:56ID: 25544176
WHat version of Crystal?
Are these Crystal parameters or storeprocedure parameters?
mlmcc