Solved

Need Subreports to Link to Main Report Date Fields

Posted on 2015-01-29
4
453 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 101

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 35

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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