Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Another current date default parameter question Post Reply Post New Topic
Author Message
RobR
Newbie
Newbie


Joined: 24 Apr 2009
Location: United States
Online Status: Offline
Posts: 18
Quote RobR Replybullet Topic: Another current date default parameter question
    Posted: 24 Apr 2009 at 7:31am

Greetings!

I have seen this problem discussed before, but the described solution will not satisfy our customer.
 
We have provided several reports to a customer that use a date-related parameter, such as asking him to enter a month and year, or asking him to select the day for which data is to be displayed. The customer has requested that the defaults for those parameters be based on the current date. For example, the default for a montly report should be the month before the current report. The default for a daily report should be yesterday.
 
I came up with a rather crude solution, at least for the monthly reports, but I hope there's a better way. The parameters are chosen from a predefined list, with January having a value of 1, February a value of 2, and so on. For the year parameter, list entry "2007" has a value of 2007, "2008" has a value of 2008, and so on. I added an option to the Month parameter list named "Previous Month", with a value of 0, and to the Year parameter list I added "Year of Previous Month". The values of both are 0. Then, in the Select Expert, I calculate the required month and year based on the current date if those parameters are 0.
 
But I'm sure the customer will think that's clumsy. I know I do. What he is expecting is if he calls up the report today, "March" should be shown as the default selection for the Month parameter. If he calls it up next January, "December" should be the default month and "2009" should be the default year. How can I do that?
 
The solution I have seen is to use a default date of some known, impossible value, such as 1/1/1900.  But the customer is not going to want his reports to come up showing "1/1/1900".  He is going to want the report parameters to show the actual values that will be used on the report, with an option to change them if he wants to.
 
Rob Richardson
 


Edited by RobR - 24 Apr 2009 at 7:35am
Richardson's First Law of Computational Unpredictability: The fact that a given occurrence is impossible does not imply that it will not occur.
IP IP Logged
RHRII
Newbie
Newbie


Joined: 13 May 2009
Location: United States
Online Status: Offline
Posts: 3
Quote RHRII Replybullet Posted: 13 May 2009 at 3:05pm
Rob,
 
Just a thought...
 
Would it be possible to have the current date stored in a database table and create a dynamic parameter linked to that table?
 
Robert R.
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.