COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Boksberger on 01 Nov 2018 05:14:36 PM

Title: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: Boksberger on 01 Nov 2018 05:14:36 PM
Hey All,

I've been able to put together a Javascript that autmatically sets the date for a prompt parameter; however, I need help finding a way to submit the page without requiring user interaction.

I've looked through the documentation, and it says to use cognos.Report.Action.FINISH but this is not working.

Does anyone have thoughts on how to do this in interactive mode? I'm on 11.0.12
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: dougp on 02 Nov 2018 11:38:13 AM
You'll need to be more specific.  Are you using the interactive viewer or the compatible viewer?
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: Boksberger on 02 Nov 2018 02:00:49 PM
The report is in interactive mode (Run with full interactivity: Yes).

I've figured this out and attached the code and report spec here for anyone interested.





Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: dougp on 05 Nov 2018 01:31:59 PM
Very nice!
Do you know if the timeout is required because internal features (like setValues) happen asynchronously?  My solution was to make the AutoFinish run at the end of PageModule.Show.  It took some experimentation to wire up the page module and the custom control reliably.
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: Boksberger on 05 Nov 2018 04:48:03 PM
I don't believe the setTimeout is required, but is there in case an asynchronous item occurs.

I have a second js as the Page Module that assigns the values for the date prompts in the page.show call. Per the documentation, the page.show should happen before any of he custom controls occur, but wanted to make sure there wasn't some asynchronous inconsistencies.
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: Calyps0 on 04 Sep 2019 03:23:03 PM
Quote from: Boksberger on 01 Nov 2018 05:14:36 PM
Hey All,

I've been able to put together a Javascript that autmatically sets the date for a prompt parameter; however, I need help finding a way to submit the page without requiring user interaction.

I've looked through the documentation, and it says to use cognos.Report.Action.FINISH but this is not working.

Does anyone have thoughts on how to do this in interactive mode? I'm on 11.0.12

How do you set the date prompts?  Do you have an example?  I keep fumbling around with this with full interactive reports and can't seem to get it to work. THanks!
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: dougp on 04 Sep 2019 06:27:43 PM
Same way as other prompt types.  Have you read the documentation?
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: Calyps0 on 06 Sep 2019 11:22:25 AM
The autosubmit.js file works great but the setdates.js one seems broken.
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: jems2021 on 07 Jan 2021 02:06:41 PM
Where can I find the autosubmit zip file?
Title: Re: JavaScript - Interactive Mode - Autosubmit Prompt Page
Post by: dougp on 07 Jan 2021 02:17:53 PM
Ah...  The dreaded Cognoise 404.

No idea.

You can try:  https://github.com/dougpulse/Cognos