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