Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set default parameter value in Crystal Report ?

Status
Not open for further replies.

hh2424

Programmer
Feb 18, 2003
37
US
How can you set a default parameter value with a value returned from a formula?

Any help is greatly appreciated.
thanks,
 
How are you running the report, where is the formula being calculated ?

More information please Gary Parker
Systems Support Analyst
 
Thanks for replying.

The report has two parameters (month and year). I'm trying to default month to last month and the year would be the associated year of the last month.
So I'll have a formula to calculate the last month
something like
month (dateadd("m", -1, currentdate))

So when the report is executed, it should default the "month" parameter to my calculated last month.
Something of equivalence to
{?month}} = month (dateadd("m", -1, currentdate)) //but this value must be set before user select parameter value and the user must see the default value as the calculated month.


 
I don't think that this can be done without using external code (such as VB, or perhaps a 3rd party viewer).

You can set values for the record selection based on a formula which uses the parameter, but you can't preset the default value in a parameter in code.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top