COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: BIExpert on 18 Mar 2009 07:57:08 AM

Title: value prompts with multi-page
Post by: BIExpert on 18 Mar 2009 07:57:08 AM
Hello all,

i'm using 8.3 edition. i've a multi-page to display some reports in tabs. each report contains 3 value prompts on the report page, 1st prompt to show years, second to show months and the last one to show days.

i wrote a javascript function to get the current date and display the current year in years prompt, current month in months prompt and so on.

and i put this function in html item at each report.

now when i run the multi-page the report in the first tab shows the current date correctly. but when i move to other tabs the function doesn't work and the prompts just show the
Title: Re: value prompts with multi-page
Post by: Sunchaser on 21 Mar 2009 06:54:16 AM
Hi,

First, one thing I don't understand is that the could we see only change the "selected" property of some objects (if I correctly understand what i see).

So what else is it supposed to do, or where is the code that is supposed to change some other property ?
Title: Re: value prompts with multi-page
Post by: BIExpert on 21 Mar 2009 06:56:06 PM
thanks Sunchaser for ur reply..

this javascript function is the whole code which i wrote. because as i know i don't need to write more code to make the value prompts shows the current date as the default selection. So please if you see that this code missing anything please tell me.

finally i wanna say this function as it is right now works fine when i run the report from its own page. but when i run the multi-page this function works fine with the report in the first tab, but when i navigate to the other tabs to see the other reports, the value prompts didn't display the current date. just display the first member in the list.

i hope that i could make the problem clear now. thanks again.
Title: Re: value prompts with multi-page
Post by: Sunchaser on 22 Mar 2009 03:42:33 PM
Hi,

As you said:
Quote
put this function in html item at each report

have you tried and tested each html item to be sure that the code is executed while the onload event occurs ?

I mean: I don't know what a multipage report looks like, but may be the onload event will "trigger" only the code of the HTML Item of the fist page ?
Title: Re: value prompts with multi-page
Post by: BIExpert on 24 Mar 2009 09:34:13 AM
hello,

i tested the onload event in each html item, when i try something like window.onload = alert('hello'); it's working fine, or when i call the same function but instead of my code i tried something like document.write('hello'); and it's working too.

about the multi-page i just make it read from the folder of the reports' pages to display these pages in tabs nothing else.

i really couldn't find the problem and hope you could help me to find it. thanks again.
Title: Re: value prompts with multi-page
Post by: rockytopmark on 24 Mar 2009 05:34:01 PM
let's dig deeper, if possible... why all this custom code?!?

Why not just use a single calendar control?  If I am not mistaken, they default to the current date...

I am not a fan of custom code that will probably break in future releases of Cognos and is generally doing something that can also be done with standard Cognos tools and functions.

Besides that, not too many users will appreciate having to set three controls, to set one date, when it is normally done with 1 control on just about every website.

If you can elaborate more on the purpose of the prompts, perhaps we can help you get a better solution that is functional and easier to maintain.