If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

how to automatically select the value in value prompt using javascript?

Started by actcognosuser, 23 Dec 2009 08:23:24 AM

Previous topic - Next topic

actcognosuser

I have only one date in my value prompt.Is there a way that that value gets selected automatically when i run the report?

can anyone share javascript for this functionality?

angela

You can do this without javascript.  Make your query use a filter like:
DateTime Stamp] =
(if (?Date? = 'Yesterday')
then ( _add_days(current_date, -1 ))
else (?Date?))

There's more information at http://it.toolbox.com/wiki/index.php/Default_a_dynamic_date_in_a_prompt_-_no_javascript

actcognosuser

Thanks Angela.But will it work in batch mode.i want to schedule the report to run every day without user intervention.




actcognosuser

Anjela,
           I have'nt used static choices before.Should the use and display value be Yesterday or should the use value be the data item [Date] that i'm prompting on.I looked up the help.But I'm not sure if I put in the right values.

In my query i have only one data item[date] ,parameter is ?NewDate?.

Here is my filter condition:

[Date] =
(if (?NewDate? = 'Yesterday')
then ( _add_days(current_date, -1 ))
else (?Date?))

WHen I enter Yesterday as static value it does not show up in the default selections?

What am i missing??

MFGF

Quote from: actcognosuser on 30 Dec 2009 07:48:07 AM
Thanks Angela.But will it work in batch mode.i want to schedule the report to run every day without user intervention.

Yes - this is a neat solution - I see no reason why it shouldn't work.  Did you try it?

You should be able to get away with just 'Yesterday' as the Use value.

MF.
Meep!

Sreeni P

Quote from: MFGF on 04 Jan 2010 07:58:54 AM
Yes - this is a neat solution - I see no reason why it shouldn't work.  Did you try it?

You should be able to get away with just 'Yesterday' as the Use value.

MF.


Did u tried MFGF, if not plese provide me the neat solution for this

MFGF

Quote from: srinivas_p on 04 Jan 2010 12:34:19 PM

Did u tried MFGF, if not plese provide me the neat solution for this

I don't quite understand this, sorry.  The neat solution is Angela's - quoted below.

Quote from: angela on 29 Dec 2009 04:26:24 PM
You can do this without javascript.  Make your query use a filter like:
DateTime Stamp] =
(if (?Date? = 'Yesterday')
then ( _add_days(current_date, -1 ))
else (?Date?))

There's more information at http://it.toolbox.com/wiki/index.php/Default_a_dynamic_date_in_a_prompt_-_no_javascript
Meep!

actcognosuser

Thanks for ur reply.!!

I'm still being prompted to select a value in the prompt for the report to execute.I have Static choice set as
As of Date for use and display value.

In the query I have filter as

[DateOn ]=
(if (?Date1? = 'As of Date')
then ( _add_days(current_date, -1 ))
else (?Date?))

In the value prompt properties what should be the value for default selections?


MFGF

Quote from: actcognosuser on 05 Jan 2010 07:55:58 AM
In the value prompt properties what should be the value for default selections?

In the Default Selections property, try entering Yesterday as the value.

MF.
Meep!