Cognos Analytics

Expand all | Collapse all

Javascript to set default values in date prompts

  • 1.  Javascript to set default values in date prompts

    Posted Sat April 03, 2021 03:04 PM
    Hi Friends,

    I need to dynamically set default values for two date prompts: 'dateFrom' and 'dateTo' (UI: Editbox & Calendar type: Gregorian).
    In the first prompt I need to set the default value to 1st day of the current year while I have to set the default value of the second prompt to current date.

    Please help me with javascript code for the above requirement. Another thing is I want the default values to appear in the format: yy-mon-dd (month should be like Jan, Feb, Mar.....) if possible.


    Regards

    ------------------------------
    Kiran Kumar
    ------------------------------


  • 2.  RE: Javascript to set default values in date prompts

    Posted Sat April 03, 2021 06:11 PM
    Hi Kiran
    Have you checked the Sample Report from CA. If you have not i suggest you start there.
    There is Date Prompt Preset Report which uses custom control using JS.
    Thanks
    Sanjay

    ------------------------------
    Sanjay Chakravarty
    ------------------------------



  • 3.  RE: Javascript to set default values in date prompts

    Posted Sun April 04, 2021 01:18 AM
    Edited by Kiran Kumar Sun April 04, 2021 01:20 AM
    Hi Sanjay,

    I may not be  able to access the sample report in my work environment.
    Could you please share with me the java script code or xml spec of the report so that I can understand?


    Thanks you,
    Kiran

    ------------------------------
    Kiran Kumar
    ------------------------------