Solved

Crystal Report SubReport Parameter Passing

Posted on 2014-04-04
5
12,063 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 Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

19 Experts available now in Live!

Get 1:1 Help Now