Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Default Value in Date Parameter Post Reply Post New Topic
Author Message
novatodd
Newbie
Newbie
Avatar

Joined: 06 May 2009
Online Status: Offline
Posts: 2
Quote novatodd Replybullet Topic: Default Value in Date Parameter
     Posted: 06 May 2009 at 11:39am
I am taking a foray into Report Design.  I have been asked to modify our existing reports to set a default value of one year from today.  The current report has a parameter field called End Date that defaults to CurrentDate.  when I edit the Parameter field, I can only insert a specific date as the default.  How can I get a calculation of 1 year from current date as the default?
 
Here is my selection criteria:
{CAL.ONDATE} in DateTime (2001, 01, 01, 00, 00, 00) to {?EndDate}
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 06 May 2009 at 1:15pm
If you're talking about having this default date show up on the parameters screen when the report is run, you can't do that in Crystal itself.
 
How are your users viewing the report?  If you have any control over the viewer you could do a couple of things in code:
 
1.  Create your own parameter entry screen and set the default there.  You then set the parameters for the report before you run it.
 
2.  In code you can set the default value for parameters on a report before you open it in the viewer.  I have sample code for this in C# if you're interested.
 
-Dell
IP IP Logged
novatodd
Newbie
Newbie
Avatar

Joined: 06 May 2009
Online Status: Offline
Posts: 2
Quote novatodd Replybullet Posted: 06 May 2009 at 1:36pm
Report is run through an application called GoldMine,  which is contact management software, but the app simply pulls up the crystal report parameter screen allowing user to select date and ID fields.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 06 May 2009 at 6:55pm
In that case, I'm afraid you're not going to be able to set this kind of default.  Crystal handles static default parameter values but not dynamic values.
 
-Dell
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