Print Page | Close Window

Using a main report paramter in 3 subreports

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9427
Printed Date: 05 May 2024 at 1:37am


Topic: Using a main report paramter in 3 subreports
Posted By: VaughnBradley
Subject: Using a main report paramter in 3 subreports
Date Posted: 18 Mar 2010 at 6:54am
I have a report that has a data source consisting of the sum of sales grouped by date. The report will only show three values. I want the user to enter one date parameter, for witch all three numbers will be based. The first would get the sum where the date equals the date parameter, the second would sum the dates for the remainder of that month (> parameter date and <= last day of month for parameter date) and the third number would be future sales (> than last day of month for parameter date).
 
My thought was that I would use three subreport and filter them as needed, but I can't seem to reference the main reports parameter. I don't want the user to have to enter in 4 parameters.
 
Does this sound doable? Is there a better way?
 
Thanks for you help.



Replies:
Posted By: BrianBischof
Date Posted: 18 Mar 2010 at 9:02am
Hi Vaughn,

Yes, you can do this. There are a few important points to know about this.

First off, make sure that the data types are the same. If they are incompatible then you can't use them to link the two reports together.

Second, before going into the Subreport Links dialog box, you have to have the parameter fields already created in both the main report and subreport.

If you have both of those items taken care of, then open the Subreport Links dialog box and choose the two parameter fields to link to in the Available Fields list and the Fields to Link To list. THEN, most important, in the bottom left corner, for the linking field dropdown box, don't use the default that Crystal gives you. Instead, click the dropdown box and choose the subreport parameter field again.  Choosing this field again is the key point to make sure the user doesn't get prompted multiple times.

That should do it for you! And I already have all this documented in Chapter 9 of my Crystal Reports Encyclopedia book. You can learn more at Amazon.com: http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Crystal Reports Encyclopedia



-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: VaughnBradley
Date Posted: 19 Mar 2010 at 11:38am
Thanks...worked perfectly!



Print Page | Close Window