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

Screen resoltuion for cognos 10.1 reports

Started by isap, 10 May 2011 06:07:34 AM

Previous topic - Next topic

isap

Hi All,
This might not be a correct question but if the experts could answer - will be much appreciated. So my users are switching between opening reports (report studio) on their laptops or projectors for presentation purposes. They run into the screen resolution issues and endless scrolling when they are switched to different resolutions. Is it possible that cognos could identify the screen on which it is opened and behave appropriately? Thanks a ton for all the responses.

MFGF

There is no inherent intelligence in the product to determine resolution, sorry.  One option is to build all reports to suit the lowest resolution you will need - this is generally the approach I take.

I guess it might be possible to add code into reports as HTML items to interactively make changes, but it's not something I've ever done (or even thought of doing), so I will leave comenting on that to the many impressive javascript/jquery experts we have on here. :)

Regards,

MF.
Meep!

Arpitagrawal9

#2
Hi,

This can be achieved using JavaScript. You just need to add a script at the end of the report. This script gets the current screen resolution and sets the size of webpage according to that.

isap

Arpit,
Thnks for your response. I am no programmer. Do you have a sample script or any suitable example? Would appreciate your effort.

Cheers

Arpitagrawal9

#4
Hi,

Well i have a sample Script which i used to develop a report for one of my client

function setPageSize(eventType)
{
//alert(document.getElementById("xxx").parentNode.parentNode.parentNode.parentNode.style.height);
//alert(document.getElementById("xxx").parentNode.parentNode.parentNode.parentNode.nodeName);
var mainSiteDiv = document.getElementById('mainsitediv');
var listDiv=document.getElementById('listDiv');
   if(document.body.clientHeight && document.body.clientHeight>250)
   {
      height=document.body.clientHeight;
   }
   else if(document.documentElement.clientHeight && document.documentElement.clientHeight>250)
   {
      height=document.documentElement.clientHeight;
   }
   else
   {
      height=475;
   }
document.getElementById("xxx").parentNode.style.height=height-10;
document.getElementById("xxx").parentNode.parentNode.parentNode.parentNode.style.height=height-10;
//alert(height);
//alert(document.getElementById("xxx").parentNode.style.height);
height=height-250;
   listDiv.firstChild.style.height=height;

}

&lt;/script&gt;</staticValue>
         </dataSource>
      </HTMLItem><HTMLItem description="Save/Read Site cookie" name="Save/Read Site cookie1">
         <dataSource>
            <staticValue>&lt;script type="text/javascript"&gt;

}


Try using this Javascript and let me know in case you still face any issue.

Hope this helps

isap

Thanks, Arpit. I really appreciate it. Will get back to you incase I stumble.


Cheers

salcg

Hi Arpit,
I have a dashboard in Cognos 8, which is basically a page with six reports on it. (I'm not using Go Dashboard).

If I have to add this code to my dashboard, where would I add it?

Please advise.

Thanks!

sujitgouda

Can we make use of it on Cognos Business Insight ?

sakthivelmani

Hi Arpit,

Thanks for the Java script. I have a cognos dashboard (page ) with four cognos viewers. Where should i add this script ? Should i add this to every single report ? Please help

Thanks,
Sakthi

Arpitagrawal9

Hi Shakti,

You should add this at the end of the dashboard using the HTML Tag

Cheers,
Arpit

sakthivelmani


xyz

Hi Arpit,

Below code when I tried to paste in the HTML item and placed after the list report in cognos report studio.
It seem's script is not working, we enclosed the script in script tags even though, it is not working, we are using Cognos 10.2.2

In the below java script code, unable to understand the below part, looks like "<" symbol is replaced with '&lt;', even thought the tags are getting closed first and then the code is written after it.

&lt;/script&gt;</staticValue>
         </dataSource>
      </HTMLItem><HTMLItem description="Save/Read Site cookie" name="Save/Read Site cookie1">
         <dataSource>
            <staticValue>&lt;script type="text/javascript"&gt;

Can you please let us know, if you have any solution.


Thanks & Regards,
XYZ