Default a parameter date to today's date in Crystal Enterprise

My report was on crystal 10.  I have it posted in the intranet via Crystal Enterprise.  When I run in Crystal 10, I can leave the date parameter blank and it defaults to today's date.   But that does not work in Crystal enterprise.  How can I have it default to today's date in Crystal enterprise?
Laura MunillaVolunteer - Board MemberAsked:
Who is Participating?
 
mlmccCommented:
What happens if you give it a default value of Today() or Now() in the report?

This may help
http://support.businessobjects.com/library/kbase/articles/c2016954.asp

mlmcc
0
 
frodomanCommented:
Unfortunately you're going to need to modify your select expert formula to take this into consideration.  Something like this:

if {?DateParam} = '' then
   {table.field} = today()
else
   {table.field} = {?DateParam}

As far as I know there's no way to have CE default to the current date.  There are some 3rd party tools out there that let you use dynamic parameters, but I've never used any of them personally.

0
 
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
frodoman's right, you will need to modify the record selection, but not in that manner.  Even if you modify the criteria to allow for  blank parameters, it will still bomb in CE.  CE doesn't like blank parameters unless you explicity make the NULLS.  Here are the steps I'd recommend:

1)  Modify the selection criteria of the report to be the following:

(
If
  {?DateParam} = #01/01/1900#
Then
  {table.field} = CurrentDate
Else If
  {?DateParam} <> #01/01/1900#
Then
  {table.field} = {?DateParam}
)

2)  Set the default parameter value in Crystal Enterprise to '01/01/1900' <Date(1900,01,01)>

In Crystal Enterprise, this will force the report to default to the Current Date unless another parameter value is specified.

~Kurt

~Kurt
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Laura MunillaVolunteer - Board MemberAuthor Commented:
Thanks
0
 
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
I object to the points awarded in this case.  Lmunilla, how did mlmcc's solution answer the question you asked?

~Kurt
0
 
Kurt ReinhardtSr. Business Intelligence Consultant/ArchitectCommented:
frodoman didn't suggest any such thing - what he said was "As far as I know there's no way to have CE default to the current date."

That is true, there isn't any way for it to default to the current date.  In order to do that, you must assign a dummy date value as the default within CE and then handle it within the record selection criteria of the report.

~Kurt
0
 
frodomanCommented:
I don't care much about the points, but in the interest of leaving this PAQ here I believe the accepted answer should be mine and/or Kurt's.  You cannot use today() / now() as defaults in CE so that will not solve the problem.

frodoman
0
 
Laura MunillaVolunteer - Board MemberAuthor Commented:
I accepted that answer as I believed the right answer right now (for what I need to do) is "You can't do it".  If this is incorrect, then, I'll like to reopen the question as Mlmcc suggested.

What I want is for  CE to list todays date in the parameter field as a default.  The user can change this to another date.- if they wish.  I have no issue filtering the data in the report to output up to today's date.  As a matter of fact, it is irrelevant for my data, cause there is no future information.  The latest info is the current date.  If there is a way to have Crystal Enterprise LIST today's date and have that change every day, then please reopen the case.

Thanks allof you for trying to get me the RIGHT answer.   :)
0
 
frodomanCommented:
Lmunilla,

Unfortunately the correct answer is that you cannot do it - CE simply doesn't support that function.  As I said (and rhinok gave details), your best bet is to create a parameter selection (whether it's 1/1/1900 as Kurt suggested or something else doesn't matter) and then have your report treat that value as the current date.

Hope that helps,

frodoman
0
 
Laura MunillaVolunteer - Board MemberAuthor Commented:
Thanks.  
0
 
cgrimes_techmdCommented:
This saved me a lot of hours researching this as one would assume you could do it.  Although the paramter when you view it will show "1900/01/01"  the data value for the report will change.  Its unfortunate but at least the report works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.