Hello,
I have a text box prompt to fill with the year. It's possible to set the default value with the current year ?
Thanks
Javascript version:
http://www-01.ibm.com/support/docview.wss?uid=swg21342970
Other solution from devworks forum:
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14679605
Quotecreate one data item
and write coding like
case when cast(extract(year,yourdataitem),varchar(4))=cast(extract(year,{sysdate}),varchar(4))
then '0'
else '-1'
end
the above code whenever the date equals to system date will give you 0
and other date give as -1
now in the "Date Value Prompt" in properties
Use Value:the above data item
Display Value:your date data item
Default Selection:0
now you run the report it will always give you current year.
Thanks.
I created that data item :
CASE
WHEN cast([REPORTING LAYER].[Calendar Time].[Calendar Time].[Year].[year],varchar(4))=cast(extract(year,current_date),varchar(4))
then '0'
else '-1'
end
It returns
CurrentMonth CurrentYear year
5 -1 2009
5 -1 2010
5 -1 2011
5 0 2012
So it seems to work but when I run the report the default year is 2011
In the value prompt for useValue I selected that data item, for the display value i selected [REPORTING LAYER].[Calendar Time].[Calendar Time].[Year].[year] and for the default '0'... That is weird
it works... it was just the cache.
But the issue is that the used value will be 0 and I need the year and the month to filter the queries
still the same issue because i need to create schedule for my reports every month. I need to find how dynamiclly fill my prompts for the current month and the current year
So i add a static choice with a use value ' ' and a display value 'current month'. But in framework manager i use a stored procedure with a month parameter. And i dont know how to pass something like that in the stored procedure : (?Month? = ' ' and [DATABASE LAYER].[calendar_time].[month] = extract ( month, current_date ))) or ([DATABASE LAYER].[calendar_time].[month] =?Month?)