Solved

Crystal Report SubReport Parameter Passing

Posted on 2014-04-04
5
12,541 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
[X]
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
  • 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.
1
 

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 35

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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. …
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 …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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