Solved

Passing multiple value parameters to a stored procedure in crystal reports

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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