Solved

Crystal Report SubReport Parameter Passing

Posted on 2014-04-04
5
12,182 Views
Last Modified: 2014-04-05
Hello Experts,

I am 100% newbie to Crystal, but I have thought my self how to make a simple report with 2 sub reports within it. Forgive my ignorance if my question doesn't make sense :)

In the main report I have a Command. In the 2 sub reports I also have 1 command per sub report (total 3 commands). Temporarily I have wrote in the end of each SQL statement (in the commands) to say where TransNum = 123. I want to replace the 123 with a report parameter. I have been able to do this using 3 separate parameters (ie: trans1, trans2, trans3) and this works BUT I want to be able to specify 1 parameter to be used in the main reports command as well and the 2 sub report commands. I have been Googleing and YouTubing but I cant seem to figure it out. Thoughts?
0
Comment
Question by:triphen
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Patrick Tallarico
ID: 39979686
You should be able to pass the command parameter value to the sub reports via the 'change subreport links function. Then you can use that value in the select expert of each subreport.
I hope that points you in the right direction.
0
 

Author Comment

by:triphen
ID: 39979912
I don't understand how the "change subreport links" work. What exactly am I doing in there?

Did you mean Database Expert? I cant see how the Select Export would take a parameter...

Thanks!
0
 
LVL 6

Assisted Solution

by:Patrick Tallarico
Patrick Tallarico earned 250 total points
ID: 39979930
When you right click on the subreport from you main report in design view, the 'Change Subreport Links' option should be in the menu.  This is how crystal reports allows for a value from the main report to be passed to the subreport.  As you are creating the link, you should be able to link it to the field in the subreport that you want to match that value to.

http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/index.jsp?topic=/com.businessobjects.integration.eclipse.designer.doc/designer/Subreports9.html

This is a video that explains the links piece of subreports.  The links in the video are accessed through the new subreport wizard, but it is quite similar from the right click menu->Change subreports.  These links should allow you to filter data in the subreport based upon the value for the parameter in the main one.
http://www.youtube.com/watch?v=xxwWFAtGSIM

The explaination is that the links allow you to pass a value from the main report to the subreport.  There is the ability to link a field from the main report to the subreport akin to a SQL join type statement.  Saying that the subreport field X should match the value of the selected value.
I hope this is a bit clearer.  I've had a bit of a long day, and I fear I may not be communicating as clearly as I'd like at this point.
Be well
0
 
LVL 34

Accepted Solution

by:
James0628 earned 250 total points
ID: 39979934
I assume that you've created the parameters in the main report and the subreports.  They should all be the same data type (eg. all 3 are numbers).

 For each subreport, open the "Change Subreport Links" screen.  Select the parameter from your main report and add it to the list on the right.  Then with that parameter selected on the right side, look at the drop-down list in the bottom left.  You should be able to select the subreport parameter there.  That links the main report parameter to the subreport parameter.

 James

 Edit: Ah, stpmt11 beat me to it.  :-)
0
 

Author Closing Comment

by:triphen
ID: 39980684
Thank you both!
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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