Print Page | Close Window

Setting Default Date Parameters

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=124
Printed Date: 15 May 2024 at 3:38pm


Topic: Setting Default Date Parameters
Posted By: 10oK
Subject: Setting Default Date Parameters
Date 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
 
 



Replies:
Posted By: hilfy
Date Posted: 16 Jan 2007 at 3:05pm
Can your batch set the value of the parameter in code?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: 10oK
Date 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 ;)
 
 
 
 


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window