Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 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
    ------------------------------

    #CognosAnalyticswithWatson


  • 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 System Admin Fri January 20, 2023 04:13 PM
    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
    ------------------------------



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

    Posted Fri April 07, 2023 08:59 AM

    Hi Kiran,

    Were you be able to find the javascript for this?

    Can you please provide if you have it?

    Thanks



    ------------------------------
    Raman Singh
    ------------------------------



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

    Posted Thu April 13, 2023 01:45 PM

    Hi Raman,

    the URL Patrick shared here  2. RE: Set Custom Default value for Date Prompt will give you access to the files needed, excluding the report spec.

    More useful links can be found there including a video.

    The uploaded Extension will then be referenced in a Custom Control component within the report.

    Hope this helps, regards



    ------------------------------
    Gertrud Lohwasser
    ------------------------------