Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Setting Default Date Parameters Post Reply Post New Topic
Author Message
10oK
Newbie
Newbie


Joined: 16 Jan 2007
Online Status: Offline
Posts: 2
Quote 10oK Replybullet Topic: Setting Default Date Parameters
    Posted: 16 Jan 2007 at 2:16am
GoodMorning,
 
I got a question, at the moment I am designing some crystal reports. What I want is to fill the parameters with a default value. For string values it isn't a problem because those are static values.
 
But for date parameters it is a problem, I want that the date value is always set to Today.  My reports can be printed in a background batch so the user cant control the input.
 
Is there a way to set the default value of a date parameter to today?
 
thanks in advanced Thumbs%20Up
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 16 Jan 2007 at 3:05pm
Can your batch set the value of the parameter in code?
 
-Dell
IP IP Logged
10oK
Newbie
Newbie


Joined: 16 Jan 2007
Online Status: Offline
Posts: 2
Quote 10oK Replybullet Posted: 16 Jan 2007 at 10:40pm
we can override the parameter values in the report in source yes, but with some reports we want to use always the current day (at time of printing).
 
When I set the default value of a date parameter it becomes a static day it won't change to the next day when printing on the next day ofcourse ;)
 
 
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 17 Jan 2007 at 7:28am
But what are you using to run your reports in a background batch?  Do you have a program that kicks them off?  If so, in that program you can set the date param value to the current day before generating the report.
 
Another option would be to set the default date to something outrageous like 01/01/1900.  You would then have a formula something like this:
If {?DateParam} = Date(1900, 1, 1) then
  CurrentDate
else
  {?DateParam}
You then use that formula in your selection criteria instead of the parameter value itself.
 
-Dell
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.