Solved

Need Subreports to Link to Main Report Date Fields

Posted on 2015-01-29
4
339 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

20 Experts available now in Live!

Get 1:1 Help Now