Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set Date Prompt default vaule in report page

Status
Not open for further replies.

onegoo

Technical User
Dec 1, 2006
6
US
hello All,
I need to create Date Prompt in report page(not in Prompt Page ),
I use script below to set date default value,but need to input value when delete Date Prompt Default Selections.
how to use script to set the default value in report page.
thanks.


<script>
function subtractDay ()
{
var dtToday = new Date();
var dtYesterday = new Date( dtToday - 86400000 ); // 86400000 = 24 hours * 60 (minutes per hour) * 60 (seconds per minute) * 1000 (milliseconds per second)
var strYesterday = [dtYesterday.getUTCFullYear(), dtYesterday.getMonth()+1, dtYesterday.getDate()].join("-");

return strYesterday;
}
pickerControlPDate.setValue( subtractDay() );
</script>

please update DatePrompt Miscellaneous property to PDate.
 
Hi , friend .
try this:

1. set date prompt ,parameter name as“PDateTime“:
Default Selections : Jan 1, 2009 12:00 AM

2?in Query add filter?and set as Optional?
case
when ?PDateTime? = '2009-01-01 00:00:00.000'
then ([Sales (query)].[Time dimension].[Date] > _add_days(current_date,-1))
else ( [Sales (query)].[Time dimension].[Date]> ?PDateTime? )
end

Anda
 
Thanks Anda
The cognos report view page will display Jan 1, 2009 in the date prompt when set default value,
and i want to display yesterday in the cognos view.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top