If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Java script and report studio

Started by bbtresoo, 17 Apr 2014 10:06:48 AM

Previous topic - Next topic

bbtresoo

Hi Guys

As you know sometimes we need to include some java script in our reports to solve some problems >:(. It's the case to set radio button horizontally or set default values dynamically. Here is my question does Cognos propose a way to create a Global style sheet or Css file or whatever containing our java script that we can remotely call from our report? you know like we do with java librairies . The fact is here at work we are setting up a standardization of our report so we think it's gonna be more practice and efficient for the maintenance of these reports.

My other question is about versioning , is it a way the set automatically versioning in my report. it's like I create a report  when I change it the version 1.1 is automatically generated. I don't know if it's possible just asking  :P.

Thanks guys for your feeback and happy Easter ;)

navissar

You can store your scripts in a .js file on the cognos server(s) and call them using the normal syntax to call js. For instance, in your "webcontent" folder create a folder named "js" and put a js file with all your functions there. Then, in the report template, add an html item with:
<script src="../js/allmyfunctions.js"></script>
that'll call the js file with your functions, and when you want to use them, you simply need to trigger them. Obviously they need to be written as generalized as possible so they'll work for any report.
CSS files store css, not javascript.

Regarding versioning, BSP offers a product that does that, including vault mechanism (Check in and check out). While you're here, click on one of their banners :)

bbtresoo

Quote from: Nimrod Avissar on 17 Apr 2014 10:16:16 AM
You can store your scripts in a .js file on the cognos server(s) and call them using the normal syntax to call js. For instance, in your "webcontent" folder create a folder named "js" and put a js file with all your functions there. Then, in the report template, add an html item with:
<script src="../js/allmyfunctions.js"></script>
that'll call the js file with your functions, and when you want to use them, you simply need to trigger them. Obviously they need to be written as generalized as possible so they'll work for any report.
CSS files store css, not javascript.

Regarding versioning, BSP offers a product that does that, including vault mechanism (Check in and check out). While you're here, click on one of their banners :)


Tks again for your tips.  but what do you mean 'you simply need to trigger them'  thought once you called them they're automatically triggered once of course you did the right object naming don't know if it's that you mean. By the way what banners are you talking about ? :)

bdbits

We use a "report" we treat as a library. It is full of among other things HTML items that have various snippets of HTML, javascript, CSS, links to stylesheets, or whatever we need to share across reports. Then we use a Layout Component Reference in the reports where we want to use them. This has worked extremely well for us, and requires no server-side changes so it is one less thing you have to track for the next time you do an upgrade.

bbtresoo

Quote from: bdbits on 17 Apr 2014 02:29:00 PM
We use a "report" we treat as a library. It is full of among other things HTML items that have various snippets of HTML, javascript, CSS, links to stylesheets, or whatever we need to share across reports. Then we use a Layout Component Reference in the reports where we want to use them. This has worked extremely well for us, and requires no server-side changes so it is one less thing you have to track for the next time you do an upgrade.

Yes tks for your feedback, could you gimme please the exact url to access the js file, read that I need to specify localhost!!. My cognos version is 10.2

bdbits

If you use Layout Component Reference objects as I suggested, you don't need a URL. The javascript will be included directly in the report.

bbtresoo

Quote from: bdbits on 22 Apr 2014 01:27:52 PM
If you use Layout Component Reference objects as I suggested, you don't need a URL. The javascript will be included directly in the report.


Hi bdbits

What do you mean by layout component reference ? please be more specific

MFGF

Meep!


bbtresoo

Big thank you to MFGF and Bdbits ;D

I've experienced shared layout component object as You advised me, it's awesome!!!! :) I couldn't expect better. It's working fine but I've another question though. Is it a way to know which report is impacted each time you modify something in your Layout library( reference report)?

in other words is it a way to know the impact of what you intend to do from the main report (layout library)? if I have hundred reports I don't want to open each one and check the layout component cache, it can be very gloomy :-[

bdbits

Unfortunately I am not aware of a built-in way to see which reports are using a component. That would be a nice feature! Perhaps BSP MetaManager does that; if not it should.  :-)

But, as long as you embed using "reference" and not "copy", you will not have to open the individual reports to have updates propagate to the target reports. This property is on the layout component reference in the target report and defaults to reference. Using reference, the component is automagically refreshed from the source library report at run time.

bbtresoo

Quote from: bdbits on 29 Apr 2014 03:33:08 PM
Unfortunately I am not aware of a built-in way to see which reports are using a component. That would be a nice feature! Perhaps BSP MetaManager does that; if not it should.  :-)

But, as long as you embed using "reference" and not "copy", you will not have to open the individual reports to have updates propagate to the target reports. This property is on the layout component reference in the target report and defaults to reference. Using reference, the component is automagically refreshed from the source library report at run time.

Tks you've already done a lot!! ;)

bbtresoo

#12
Hi guys
I'm a bit disgusted, I'm able to share Pie chart as a layout component reference but not able to do any action on it as drop measures, series etcccc . <mod edit> Oh goodness gracious me! </mod edit> it would be so awesome if it was possible. Any workaround ?

Tks in advance

MFGF

Quote from: bbtresoo on 07 May 2014 04:02:29 PM
Hi guys
I'm a bit disgusted, I'm able to share Pie chart as a layout component reference but not able to do any action on it as drop measures, series etcccc . <mod edit> Oh goodness gracious me! </mod edit> it would be so awesome if it was possible. Any workaround ?

Tks in advance

I'm afraid the clue is in the title - Layout Component reference. It's for report layout objects not for data containers and is designed to allow you to set up standard "look and feel" for reports which show different data.

Do please take care with your language, too - we may have young, impressionable kids or dear little old ladies on the site, and we don't want to shock them... :)

MF.
Meep!

bbtresoo

Quote from: MFGF on 07 May 2014 04:07:14 PM
I'm afraid the clue is in the title - Layout Component reference. It's for report layout objects not for data containers and is designed to allow you to set up standard "look and feel" for reports which show different data.

Do please take care with your language, too - we may have young, impressionable kids or dear little old ladies on the site, and we don't want to shock them... :)

MF.

yes you're right sorry for that. :-[ just escaped from my mouth!!!