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
Solved

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

Posted on 2013-01-23
7
1,152 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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