Solved

Passing multiple value parameters to a stored procedure in crystal reports

Posted on 2013-01-07
5
1,680 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now