Link to home
Start Free TrialLog in
Avatar of Michael Katz
Michael KatzFlag for United States of America

asked on

Need Subreports to Link to Main Report Date Fields

I have a main report that I need to have 2 Parameter Date fields... However there are not Main Report Fields that have dates..  

I created 2 Shared Variables..
@SharedBegDate  
WhilePrintingRecords;
Shared DateVar  MRPBegDate:={?BegDate};""

and

@SharedEndDate
WhilePrintingRecords;
Shared DateVar  MRPEndDate:={?EndDate};""

These are both at the ReportHeader in the Main Report

In the GH2b I am calling the subreport...within the subreport I have the corresponding formulas @SharedBegDate, @SharedEndDate
shared DateVar  MRPBegDate;
and
Shared DateVar  MRPEndDate;   Respectively

The problem is that I am unsure how to show the detail of the subreport based on the these dates...The subreport has a datetime field that I am sure  I need to format.. but not sure how to do that while incorporating the variables.. Please help
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Katz

ASKER

When I select the ?BegDate without the pm_.. the Select data in subreport based on field is greyed out..

I have added the same labeled parameter with identical data type to subreport...nothing allows me to link
I got it...I was trying to use a Parameter Field from Main Report to a Parameter Field in SubReport...I changed the SubReport Parameter Field to a Formula Field Date({DateTime}) and it works.. Thanks
Avatar of James0628
James0628

When I select the ?BegDate without the pm_.. the Select data in subreport based on field is greyed out..
That's correct.  What you're doing there is linking the main report parameter (or field or whatever) to a subreport parameter that already exists, and when you do that, it's up to you to decide how the subreport uses that parameter.  So, the "Select data ..." option is greyed out.  You would need to go into the record selection formula in the subreport and use the parameter there (the last part of mlmcc's post).  IOW, you'd be adding the "Select data ..." part "manually", by editing the record selection formula.

 James