Print Page | Close Window

Parameter default formulas

Printed From: Crystal Reports Book
Category: General Information
Forum Name: New feature request
Forum Discription: Share what features you want to see in the next release of Crystal Reports.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6704
Printed Date: 28 Apr 2024 at 7:49pm


Topic: Parameter default formulas
Posted By: RobR
Subject: Parameter default formulas
Date Posted: 12 Jun 2009 at 1:50pm
Our product includes several reports written in CR XI.  Several of them have date parameters.  For example, a Daily Production report asks the user to enter the date he wants the report for.  The customer, not surprisingly, wants the default value to be whatever yesterday's date was.  The only way I've seen to do that is to have the parameter default to some ridiculous date like '1/1/1900', and the have the select formula check to see if the parameter matches the strange date, and then calculate yesterday's date if it does. 
 
CR lets us write formulas for everything else.  Can't we have a "parameter default formula"?  We'd just enter a default formula of "DateValue(DateAdd("d", -1, CurrentDateTime)), and voila!  Every time the user opens the report, the parameter screen shows yesterday's date!
 
By any wild chance (he says with no hope whatsoever), does CR 2008 offer that feature?
 
RobR


-------------
Richardson's First Law of Computational Unpredictability: The fact that a given occurrence is impossible does not imply that it will not occur.



Replies:
Posted By: RichIcicle
Date Posted: 02 Feb 2011 at 11:22am
I agree that the ability to default report Parameter Fields (static or dynamic) to an initial value other than blank or a hard coded value would be a most excellent addition to crystal reports.
 
I have a report that I would like to default the prompt to the current date.  That could be done with the use of the CurrentDate function in the Parameter wizard's Default Value field.
 
I also want to defaut a username prompt to the current login user.
 
My ultimate objective is having a user press a button and generate today's report without the user having to think about dates or who they are.
 
Thanks for listening,
Rich



Print Page | Close Window