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.
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.
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.
Arpit,
Thnks for your response. I am no programmer. Do you have a sample script or any suitable example? Would appreciate your effort.
Cheers
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;
}
</script></staticValue>
</dataSource>
</HTMLItem><HTMLItem description="Save/Read Site cookie" name="Save/Read Site cookie1">
<dataSource>
<staticValue><script type="text/javascript">
}
Try using this Javascript and let me know in case you still face any issue.
Hope this helps
Thanks, Arpit. I really appreciate it. Will get back to you incase I stumble.
Cheers
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!
Can we make use of it on Cognos Business Insight ?
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
Hi Shakti,
You should add this at the end of the dashboard using the HTML Tag
Cheers,
Arpit
Thanks, Arpit. I will try this.
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 '<', even thought the tags are getting closed first and then the code is written after it.
</script></staticValue>
</dataSource>
</HTMLItem><HTMLItem description="Save/Read Site cookie" name="Save/Read Site cookie1">
<dataSource>
<staticValue><script type="text/javascript">
Can you please let us know, if you have any solution.
Thanks & Regards,
XYZ