Solved

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

Posted on 2013-01-23
7
1,135 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

20 Experts available now in Live!

Get 1:1 Help Now