Solved

Crystal reports 2011 - passing  mult-select parameter values to subreport

Posted on 2013-01-23
7
1,140 Views
Last Modified: 2013-02-26
I have a report where the amount of data that's being return is enomorous when the user chooses to bring back all personnel and their training for their department.  

We have a multi select prompt which allows the user to select the training that they wish to display on the report.  This filter is done in Crystal in selection record formula.

I would like to  pass the selected multiple titles to a subreport and have the query bring back only records that match the titles that were selected.

Main report - have only the multi-select parameter.
Sub report - select from datasource where title_id = multi-select title_id

Can this be done?
0
Comment
Question by:cookiejar
7 Comments
 
LVL 18

Accepted Solution

by:
vasto earned 250 total points
ID: 38811785
You can use Join({?Parameter},',')  to create a concatenated string with the values and pass it to the subreport. Subreport can use this in a command or pass it to the database where it will be parsed and used.

See some examples of joining and parsing the data here:
http://www.r-tag.com/Pages/MultivalueParametersWithSQLSP.aspx

At the very bottom are the samples for Crystal Reports
0
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 250 total points
ID: 38812093
Based on what you've described, you don't have to use any special functions or formulas.  Just build your subreport with a parameter that allows multiple selection and use it in the subreport's record selection criteria.  Then, link the subreport to the main report based on the parameter field in the main report to the parameter field in the subreport.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 38812720
Agree.  You can link the main report parameter to the subreport parameter?

Is there a reason for doing this as a subreport?

mlmcc
0
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.

 

Author Comment

by:cookiejar
ID: 38812750
On the server side, we're filtering by department and returning all training records for that department.  

On the client side is where the user will apply the filter to bring back the training records out of that department they wish to view.

I thought by passing the multi-select values to the query command of the subreport would force the server to filter out the selected training records.  But now, I see this is not possible unless I pass the the values to a stored procedure.   By using that method I have a limit as to the side of the string that can be passed to ORACLE varchar2 field.
0
 
LVL 18

Expert Comment

by:vasto
ID: 38812761
What about CLOB ?
0
 

Author Comment

by:cookiejar
ID: 38812774
I will check with the ORACLE experts to see if this can be done.
0
 
LVL 34

Expert Comment

by:James0628
ID: 38813712
I haven't used the more recent versions of CR, but I think I read that some of them support using a multi-value parameter with a CR Command (CR presumably replaces the parameter with a separate test for each value in the parameter).  Even if that's true, it may not work with Oracle, but it might be worth looking into.

 James
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

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 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

21 Experts available now in Live!

Get 1:1 Help Now