Solved

Crystal Report SubReport Parameter Passing

Posted on 2014-04-04
5
11,906 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you both!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 …
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

12 Experts available now in Live!

Get 1:1 Help Now