Solved

Passing multiple value parameters to a stored procedure in crystal reports

Posted on 2013-01-07
5
1,762 Views
Last Modified: 2013-01-08
How can I pass multiple value parameters to a stored procedure in crystal reports?
Thanks.
0
Comment
Question by:Star79
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:vasto
ID: 38752994
The most popular way is to use a subreport and to pass the parameter from the main report to the subreport using a formula to join the values:
Join({?Parameter},',')

The subreport will use a stored procedure and the stored procedure will parse these values to a table and process them.
Details about this method ( and some others) are available here:
http://www.r-tag.com/Pages/MultivalueParametersWithSQLSP.aspx
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38753115
Agree.  Most stored procedures cannot accept a multiple value parameter.

You can as stated above pass a list of values but you ill have to
1.  Use a subreport and build the list in the report.
2.  Run the report from an application and build the list in the application and pass it.

mlmcc
0
 

Author Comment

by:Star79
ID: 38754962
I used the subreports and the multi value parameter is passed to the storeproc as
C-II,C-III,C-IV.How can I separate the params as
'C-II','C-III','C-IV','C-V' and pass them in my select query like
select * from drugs where class in('C-II','C-III','C-IV','C-V' )

Can it be done in sql or crystal?

Thanks,
Roopa.
0
 

Author Comment

by:Star79
ID: 38755606
Hello,
I created the sql to parse the parameter and the storproc works fine.But the sub-report is not displaying data.I created the formula field Join({?Parameter},',') to produce the comma separated params in the main report.How should I link the main report to the sub-report?
0
 
LVL 18

Accepted Solution

by:
vasto earned 500 total points
ID: 38755743
You can see an example how to write the parsing part in the provided link .
About the linking : right click on the subreport and select menu "Change Subreports Links". Find your formula inside "Available fields" tree and click the button ">" to move it to "Fields to link to". Then Select this formula and your subreport parameter and click the button "OK". Subreport parameter is in the combo box in the bottom left corner.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question