multi select paramneter in crystal report

Can stored procuedre input parameter used as crystal report multi select parameter?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kalpesh ChhatralaSoftware ConsultantCommented:
kamsetty_prasadAuthor Commented:
Hi ,

I have created a stored procuedure with the paramter social code.  And created the  Crystal report .
I want to allow user to select mulitple social code. I modified the stored procedure input paramter to multiselect. but when I preview the report it is passing null value to stored procedure.

One more thing what is delimter the multiselect is using.
Crystal doesn't support passing multiple value parameters to a SP.

Crystal uses an array for multiple value parameters.

Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

kamsetty_prasadAuthor Commented:
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
Actually, this is a SQL limitation, not a Crystal Reports limitation.  SQL doesn't allow multiple value input parameters.  That being said, I have a technique for getting around the limitation.  The basic steps are:

1)  Create an empty crystal report with a multiple-value string parameter
2)  Create a formula that joins all of the selected values into a single string array
3)  Build a subreport that uses either a parameterized  SQL Command or Stored Procedure as its data source
4)  Link the main report to the subreport on the formula in the main report to the parameter in the Command or Proc

The benefit to this approach is that you get the Crystal Reports multi-parameter functionality and can still pass it into the SQL for efficient processing.  Here's a sample report:

kamsetty_prasadAuthor Commented:
I am able to follow the first 2 steps. Facing problem to link main report to subreport
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
What kind of problem, specifically?

1)  You need to make sure the datatype for your formula are the same as the data type for your parameter field in your proc.
2)  Since your formula is creating an array of values that's formatted like this 'A','B','C' you'll need to make sure your proc accounts for an array like this table.field in (@parameter)
3)  When you link the main report to the subreport, crystal will automatically create a parameter starting with  ?pm- . You do NOT want to link based on this field.  Instead, drill down into the possible parameter values and select the actual parameter that exists inside the proc.

kamsetty_prasadAuthor Commented:

I have modified the report as per the suggestion. But what happening while preveiwing I need to click the subreport to view teh actual result.
You apparently made the subreport an On Demand subreport or it is in a section that requires drill down

Right click the subreport
I believe it is on the last tab
  checkbox for ON DEMAND

kamsetty_prasadAuthor Commented:
no it is not ondemand.
report also we need to click on the subreprot.
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
My sample report does not have an on demand subreport.  The question is whether or not your report has an on demand subreport.  If you have to click it to see the results then yes, it's an on demand subreport.

kamsetty_prasadAuthor Commented:
Sorry for delayed response.  I was on vacation last few days.

My report also on not a on demand report. But I just reviewed the sample report you have provided.

In that report also I have click to open the sub report. Eventhough it is not on demand.

Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
What do you mean by "open the sub report"?  In order to edit the subreport or drill down into it you do need to click it.  But the data is visible in the main report without clicking.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.