Hide 2 top rows in prompt

When making a custom prompt, eg for switching between crosstab and chart, you can hide the first two lines of the prompt.

Put a html item besides the prompt and put the next code in there:

<script language=”javascript”>

var f = getFormWarpRequest();

var list = f._oLstChoicesPrompt1;

list.remove(1);

list.remove(0);

list.removeAttribute(“hasLabel”);

</script>

Prompt1 is the name of the prompt. This can be found at the bottom of the properties of the prompt.

This script is used in Cognos 8.4.1

Update 07-12-2012

The javascript above only works in a report. When you put the report in a dashboard the javascript doesn’t work properly.

The following javascript works both in Report Studio reports and on reports on a dashboard:

<script language=”javascript”>

var fW = (typeof getFormWarpRequest == “function”?getFormWarpRequest() : document.forms[“formWarpRequest”]);

if( !fW || fW == undefined)

{

fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ );

}

var list = fW._oLstChoicesPrompt1;

list.remove(1);

list.remove(0);

list.removeAttribute(“hasLabel”);

</script>

Information pop-up in Cognos report

A customer wants some information in the report about filters and conditions.

One way to create this is with some html:

<html>
<head>
<script type=”text/javascript”>
<!–
function Info() {
alert(“<PUT YOUR OWN TEXT /INFORMATION HERE>”);
}
//–>
</script>
</head>
<body>
<!–<p>Can be used to add text before the button:</p>–>
<form>
<input type=”button” value=”REPORT INFORMATION” onclick=”Info();” />
</form>
</body>
</html>