Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using parmeters inmain and subreport formulas Post Reply Post New Topic
Author Message
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Topic: Using parmeters inmain and subreport formulas
     Posted: 21 Dec 2010 at 6:35am
My main report has 3 parameters  @startdate  @enddate  @year
I do not use them in the selection criteria but instead use them within the formulas to obtain cy and ly data. 
 
I have a subreport that uses an entirely different datebase.  This report also has the same 3 parameters but again I do not use them in the selection criteria only in formulas to obtain cyand ly date.
 
The only selection criteria I have is to select records from 1/1/09 and on.
(This leads me to 1 of my questions.  Because the data that is needed for the report is 2010 and 2009 data I placed the selection criteria to be records >= 2009.  Is there a better way to handle this?
 
Now for the main question.  How do I go about linking the subreport so the user is only prompted for Start Date, End Date and Year once.
The main report has the field as a Date while the subreport uses a field which is datetime.  For ex:  If year({custprob.probttm}) = Year({?EndDate}) -1) then 1 else 0 (to perform a count of records within that time frame).  In this case PROBDTTM is a date field.  On the subreport there is something similar to this but the field type is datetime.
 
If anyone can help I certainly would appreciate it.  Thanks in advance.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Dec 2010 at 3:30am
you should be able to right click on the subreport and select 'Change Subreport Links', then just click on the parameter in the main report list and CR will probably show the same named variable from the subreport, if they are correct, move on to the next parameter, if not, find the field/parameter in the subreport that the parameter maps to.
 
HTH
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