Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing multiple value parameters to a stored procedure in crystal reports

Posted on 2013-01-07
5
Medium Priority
?
1,834 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 101

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

660 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