Solved

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

Posted on 2013-01-23
7
1,143 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Select Cross-tab total 2 62
Basic Crystal Report not showing up on ASP.NET page 4 82
Crystal Reports 9 and Subreports 3 65
Crystal Reports 2008 6 32
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…
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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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