Launch the Report Studio ,drag HTML object into workspace and paste the below code
<script>
document.formWarpRequest._oLstChoicesReportDetailID.remove(0);
document.formWarpRequest._oLstChoicesReportDetailID.remove(0);
document.formWarpRequest._oLstChoicesReportDetailID.removeAttribute('hasLabel');
setTimeout('listBoxReportDetailID.checkData()', 100)
</script>
In the above code,ChoicesReportDetailID is the ID of the Prompt
Tuesday, 2 August 2011
JavaScript to limit the number of items in multi-select Text Box Prompt - Cognos 8
<script>
var form = getFormWarpRequest();
var textBox = form._textEditBoxMarketID;
var parent=textBox.parentNode;
var select;
do {
parent= parent.parentNode;
var select= parent.getElementsByTagName("select");
} while(select.length ==0);
var opt = select[0].childNodes;
var length=opt.length
if (length > 5) // User can select maximum of 5 values from prompt.
{
alert("You have selected " + length + " O&Ds, Please select only 5 or less ");
}
</script>
In the above code, MarketID is the ID of the TextEditBox Prompt
var form = getFormWarpRequest();
var textBox = form._textEditBoxMarketID;
var parent=textBox.parentNode;
var select;
do {
parent= parent.parentNode;
var select= parent.getElementsByTagName("select");
} while(select.length ==0);
var opt = select[0].childNodes;
var length=opt.length
if (length > 5) // User can select maximum of 5 values from prompt.
{
alert("You have selected " + length + " O&Ds, Please select only 5 or less ");
}
</script>
In the above code, MarketID is the ID of the TextEditBox Prompt
Close Additional popup window opens in cognos 8 and cognos 10
1. Go to \webcontent\pat folder
2. In the pat folder, locate rsapp.htm and make a copy of this file as a
backup.
3. Open rsapp.htm in any editor preferably HTML editor and scroll to the bottom
of this file.
4. Add the following code above the </body></html>
<script>var myparent = window.opener; myparent.close();</script>
5. Save the rsapp.htm. (Ensure you save this file against as HTML
format)
2. In the pat folder, locate rsapp.htm and make a copy of this file as a
backup.
3. Open rsapp.htm in any editor preferably HTML editor and scroll to the bottom
of this file.
4. Add the following code above the </body></html>
<script>var myparent = window.opener; myparent.close();</script>
5. Save the rsapp.htm. (Ensure you save this file against as HTML
format)
Subscribe to:
Posts (Atom)