I am not quite sure if this can be done within BO or at a data level.
We have some reports where the user will be able to select the month he wants the see through the use of prompts.
We want to be able to set the default value to the current month.
I know you can set the default value in Designer but it would have to be changed every month…
I can’t think of any ways of doing this so any ideas would be welcome.
In Designer, try setting the LOV to refresh before use and then edit the LOV to select the max month where date <= current date using a calculation in a query by editing the list of values. Not sure how this will effect your list of values for choosing other months, but it should return the current month. I’ve not tried it yet, but I’ll try it tonight on non-chargeable time! Update to follow tomorrow 9am (UK time)
Thank for confirming it . I 've got one more question. If we do that way does the Current Month show in the Prompt TextBox automatically or user has to select from LOV I think it will not by default find its place in the TextBox.
The best way of doing so is to create a filter in the designer. You did not write what D.B you are using so I assume for the purpose of my example it is Oracle.
The designer should create a filer that looks like that:
month= decode (prompt (‘enter a month or an astrik for last month’),’*’,to_char(sysdate,‘mm/yyyy’),prompt (‘enter a month or an astrik for last month’)).
Now, when you use this filter, when ever the user puts an astrik it will regard it as if he put the last month.
Yes first time user have to select it from the LOV. Also I foresee another thing when there is a changeover of month from May to June. If the report is run for May and tomorrow is June then I think the textbox will show May