cancel
Showing results for 
Search instead for 
Did you mean: 

Passing multiple selection values from Crystal UI to a stored procedure

Former Member
0 Kudos

We have a Crystal Report that is fed by a stored procedure in SQL Server. There are two date params to the stored proc and the user can select dates which are used to filter the data. This part seems to work just fine.

There are also two additonal params which hooked to multiple selection values. If I create two additional params in the stored proc of type varchar(max), how can I extract the values selected on the Crystal parameter collection UI - say 1,2,3 - and pass them to the stored proc so SQL Server can filter the data instead of using Crystal's record selection formula?

Thanks

Carl

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Carl,

Create a multi value parameter for the values which you want to pass to SP parameter in the main report.

Create one formula as below in main report:

join(parameter,",")

Link the main report with subreport using this formula.

From subreports select the SP parameter.

When you refresh the report, you can pass multiple value to the parameter, these values will be passed to the SP parameter.

HTH,

Sumit

Answers (1)

Answers (1)

Former Member
0 Kudos

Carl,

The only way to pass a multi-value parameter to a SP or SQL Command is to create the parameter and a formula that will reformat the multi-value values into asingle sring array and then pass that string to a sub-report which has the SP or SQL Command.

Basically you can just embed your existing report, as a sub-report, into a new "shell" report. For more details, check out this thread... [SQL Command Parameter - Multiple Value|]

HTH,

Jason