Topic
  • 3 replies
  • Latest Post - ‏2013-02-05T13:06:34Z by DanielWagemann
Romrejs
Romrejs
5 Posts

Pinned topic Javascript in Cognos report

‏2013-02-04T15:44:55Z |
Hi,

I would like to use JavaScript in my report's prompt (disable Finish button while selecting "Global" in radio-button group).

Are there any disadvantages of this solution? I only know that there can be a problem while upgrading.

Thanks for your answers.

Kind regards,
Roman
Updated on 2013-02-05T13:06:34Z at 2013-02-05T13:06:34Z by DanielWagemann
  • DanielWagemann
    DanielWagemann
    411 Posts

    Re: Javascript in Cognos report

    ‏2013-02-04T18:38:20Z  
    Although there should not be an issue in doing this, you should ask yourself whether or not you really need the JavaScript.

    Since you are disabling the finish button until something for a prompt value is chosen, it tells me that we are probably dealing with an optional prompt/filter object. So that means you do not want someone to run the report without selecting a value for the optional filter.

    From here you would have two non-javascript solutions.
    1) Make the prompt and filter mandatory, then the finish button is not enabled until a prompt value has been chosen.

    2)Leave it optional and assign a default prompt value either via the prompt control properties or using the third parameter of a prompt macro if the default value has to by dynamic.
  • Romrejs
    Romrejs
    5 Posts

    Re: Javascript in Cognos report

    ‏2013-02-05T09:24:52Z  
    Although there should not be an issue in doing this, you should ask yourself whether or not you really need the JavaScript.

    Since you are disabling the finish button until something for a prompt value is chosen, it tells me that we are probably dealing with an optional prompt/filter object. So that means you do not want someone to run the report without selecting a value for the optional filter.

    From here you would have two non-javascript solutions.
    1) Make the prompt and filter mandatory, then the finish button is not enabled until a prompt value has been chosen.

    2)Leave it optional and assign a default prompt value either via the prompt control properties or using the third parameter of a prompt macro if the default value has to by dynamic.
    Daniel, you are definitely right. I have already asked myself. From my point of view I would prefer not to use it, but business wants and I have to tell them why not use JavaScript.

    The background of this problem is that user can choose from prompt "wrong combination" - Global(all countries) without selecting any customer group. It will result in selecting all rows from fact table with about 3 million rows, taking about 95% of resources and finally crashes a Cognos Services.

    I have also found several solutions:

    1) Make the filter and prompt mandatory - it is not possible, because there are 3 other ways how to select customer (enter number in Text box, search for account number or search for a group). The problem came when user enter number to text box and doesn't know the customer group.
    I re-think this solution in adding a static choice with "All Customers", which prevents the problem with 3 other ways of selection mentioned above. But it was refused by business.

    2)Set Maximum row limit - limit a number of rows retrieved to the row limit of Excel 2007 - no other format is allowed.

    3)Split report - one version with Global (all countries) with some kind of implementation in 1)

    4)Limit database user - I am on Teradata database, so there is possibility to limit user spoolspace.

    Currently we are implementing 4), but business still wants JavaScript. Is there any "show stoppers", problems, warnings why NOT use JavaScript? I would need to have some "ace in my hand".
  • DanielWagemann
    DanielWagemann
    411 Posts

    Re: Javascript in Cognos report

    ‏2013-02-05T13:06:34Z  
    • Romrejs
    • ‏2013-02-05T09:24:52Z
    Daniel, you are definitely right. I have already asked myself. From my point of view I would prefer not to use it, but business wants and I have to tell them why not use JavaScript.

    The background of this problem is that user can choose from prompt "wrong combination" - Global(all countries) without selecting any customer group. It will result in selecting all rows from fact table with about 3 million rows, taking about 95% of resources and finally crashes a Cognos Services.

    I have also found several solutions:

    1) Make the filter and prompt mandatory - it is not possible, because there are 3 other ways how to select customer (enter number in Text box, search for account number or search for a group). The problem came when user enter number to text box and doesn't know the customer group.
    I re-think this solution in adding a static choice with "All Customers", which prevents the problem with 3 other ways of selection mentioned above. But it was refused by business.

    2)Set Maximum row limit - limit a number of rows retrieved to the row limit of Excel 2007 - no other format is allowed.

    3)Split report - one version with Global (all countries) with some kind of implementation in 1)

    4)Limit database user - I am on Teradata database, so there is possibility to limit user spoolspace.

    Currently we are implementing 4), but business still wants JavaScript. Is there any "show stoppers", problems, warnings why NOT use JavaScript? I would need to have some "ace in my hand".
    Other than the officially unsupported (until 10.2) and may not upgrade clauses, I personally have not exeperienced any negative side effects to using JavaScript to supplement product functionality around prompting.