Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreport parameters being passed FROM subreport Post Reply Post New Topic
Author Message
saclifford
Newbie
Newbie


Joined: 11 Feb 2009
Online Status: Offline
Posts: 5
Quote saclifford Replybullet Topic: Subreport parameters being passed FROM subreport
     Posted: 07 Jan 2010 at 1:44pm
I have a report that contains one subreport.  The main report and the subreport each have a parameter field that prompts the user for a date range {?month} and each report is grouped by {region}. 
 
I'd like the user to be prompted for the {?month} twice: once for the main and once for the subreport (they will be different date ranges) and have all of the data grouped by {region}:
 
REGION1
*Main report header
main report records that are in main report date range
*Sub report header
subreport records that are in sub report date range
REGION2
*Main report header
main report records that are in main report date range
*Sub report header
subreport records that are in sub report date range
 
Currently, everything thing works correctly with the sorting (the main and sub-reports are linked by {region}, NOT the date range) and the subreport is in the {region} group footer in the main report. 
 
The user, however, is only prompted for the date range of the subreport and then ALL of the records are pulled based on what the user enters; the user isn't prompted for both the main and subreport date range.  I checked my record selection criteria for both reports and they look ok; if I remove the subreport, the user is prompted for a date range as expected, so I think I've done something wrong when adding the subreport.
 
Any ideas on what's happening?  What am I missing?
 
Thanks!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Jan 2010 at 5:50am
as a first guess, are you using the same name as a date parameter for both the main and subreport.  If the same name is used, CR would probably see the the need for only 1 input.
 
HTH
IP IP Logged
saclifford
Newbie
Newbie


Joined: 11 Feb 2009
Online Status: Offline
Posts: 5
Quote saclifford Replybullet Posted: 11 Jan 2010 at 7:36am

Thanks for responding!  I thought that, too, so I made sure that my parameter and field names were different between the two reports.  I still had the problem with the date range parameters.

Also, upon further inspection, I discovered the user is prompted for a date range for the sub-report and the main report is using it as well, not the other way around.
 
I have my subreport in the region group footer of the main report so that all of the records of the main and subreport are grouped together by region.  I tried moving it to other sections of the main report, just to test the parameter prompt problem; the user is still only prompted for the subreport date range and that date range is used by both reports. 
 
ARRRGGG!  Anyone have any other suggestions?
IP IP Logged
saclifford
Newbie
Newbie


Joined: 11 Feb 2009
Online Status: Offline
Posts: 5
Quote saclifford Replybullet Posted: 12 Jan 2010 at 8:53am

I was messing around with the report and the user actually IS being prompted for a date range that is being used in both the main and subreport.

I've updated my field names so that they are month1 (main report) and month2 (subreport), but the user is still prompted for one date range, not two (one for the main report and one for the subreport) and confirmed that neither month field is being used as a sub report link.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum