Solved

Need Subreports to Link to Main Report Date Fields

Posted on 2015-01-29
4
382 Views
Last Modified: 2015-01-30
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
0
Comment
Question by:Mikeyman_01
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40578065
Rather than using shared variables to link, just link the main report parameters to the subreport parameters.

The linking will create a selection formula which you will need to edit to change it from = to >= and <= for the range.

RIght click the subreport
Click CHANGE SUBREPORT LINK
Select the start parameter
Click the > to move to the top right panel
In the left dropdown select the subreport parameter (not the one suggested that begins with pm_)
Select the field in the subreport to filter on
Repeat for end parameter

Open the subreport
Display the SELECTION FILTER
Change the comparisons so you are using a range
{?startParam} <= {Datefield} and {?endparam} >= {Datefield}

mlmcc
0
 

Author Comment

by:Mikeyman_01
ID: 40578150
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
0
 

Author Comment

by:Mikeyman_01
ID: 40578214
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
0
 
LVL 34

Expert Comment

by:James0628
ID: 40579466
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
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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 …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

815 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

11 Experts available now in Live!

Get 1:1 Help Now