Bilbo Bilbo - 2 months ago 9
HTML Question

Adding Javascript/HTML Form functionality to an 'html item' in COGNOS Report Studio v10

Below is the code that I would like to insert into my COGNOS report using an html item;

<html>
<head>
<script>

function openWindow()
{
windowObject = window.open('http://www.google.com/','_blank','width=400,height=700,status=yes,resizable=yes,scrollbars=yes');
windowObject.focus();//gives focus to window
}

</script>
</head>
<body>

<FORM METHOD="LINK" ONSUBMIT="openWindow()">
<INPUT TYPE="submit" VALUE="Info">
</FORM>

</body>
</html>


If I copy and paste this into an html item within COGNOS Report Studio odd things happen and it doesn't work. Any ideas how I can get it to work properly? Thanks in advance for your help!

Answer

In COGNOS Report Studio I was able to drag in a single 'html item' onto my report and put the following code in it;

<script>

function openWindow()
{
windowObject = window.open('http://www.google.com/','_blank','width=400,height=700,status=yes,resizable=yes,scrollbars=yes');
windowObject.focus();//gives focus to window
}

</script>

<input type="button" value="Info" onclick="openWindow();" />

Now there is a button in the upper right of my chart that once clicked opens a separate window (with a set size) to additional information pertaining to the chart.

Comments