COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: rcaesar on 11 Feb 2010 09:08:24 AM

Title: Using Javascript
Post by: rcaesar on 11 Feb 2010 09:08:24 AM
Hi Gurus,

I just wanted to know if JavaScript can be used in C8? I am new to C8.4, and I have used JavaScript in 7.4.

After some searching, I found out that if I brought HTML item into a report, I could use JavaScript - but it says only in the HTML mode (display).

Can't this be used in the pdf or the Cognos viewer?
I am sure I am missing something here, but would appreciate any help.

Thanks
Title: Re: Using Javascript
Post by: MFGF on 11 Feb 2010 09:44:09 AM
Hi,

Yes, you can embed javascript into the reports using HTML items, but this will only be valid for HTML rendered reports, but not for any other rendering type (PDF, Excel, csv etc).  Typically the Cognos Viewer will be used to present all these rendering types.

MF.
Title: Re: Using Javascript
Post by: rcaesar on 11 Feb 2010 10:32:47 AM
Hmm!

Thats a bit of a let down. In the old 7.4 - I could use javascript and the pdfs worked fine with the js.

In any case, I appreciate all your responses.

RS
Title: Re: Using Javascript
Post by: MFGF on 11 Feb 2010 11:20:32 AM
What do you want to use javascript for?  You might find the relevant functionality is already available in Cognos 8 without having to resort to hacking in code like this.  Cognos 8 is far more advanced than the old CS7 stuff...

MF.
Title: Re: Using Javascript
Post by: rcaesar on 11 Feb 2010 12:49:31 PM
Hi MF,

Actually, I would prefer if didn't have to. Some of the reasons are the flexibility to format, use/format buttons & prompts. I could, for example, use radio buttons, format, label, etc quite easily in JS.

C 8.4 - seems restrictive  - when I look at the properties for radio button or check boxes. I am still unsure whether I will be able to use a radio button group to select different reports, without using javascript or something similar in C 8.4.

Of course, it could well be that I need to read up and do a lot more research.

I am going to try the TOC which you suggested, and may be that will work.

Once again, appreciate all the help.
Best
RS