Posts

Showing posts with the label JavaScript

How to add single select check box with Auto Submit Option

1. Create text Box Prompt for parameter and set default value to 1 ( we are going to use it for default selected).  Name it PromptOpt. 2. Make it's property visible to No. 3. Add HTML item before it with below script and check box . < script text= "javascript"> function handleClick(cb) { var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]); if ( !fW || fW == undefined) { fW = ( formWarpRequest_THIS_ ? formWarpRequest_THIS_ : formWarpRequest_NS_ ); } var f = getFormWarpRequest(); var list1 = f._textEditBoxPromptOpt; list1.value = 1; canSubmitPrompt(); SetPromptControl('reprompt') ; } < / script> < TABLE class=tb style="WIDTH: 150px; BORDER-COLLAPSE: collapse" cellPadding=0> < TBODY> < TR class=tableRow> < TD class=tableCell onclick="handleClick(this)"> < DIV class=block>< input type="...

How to go back to previous screen in Cognos using Java Script

Steps: 1. On report page create Prompt Button with Type as "Back". 2. Add HTML item with below script before button --< script type="text/javascript"> function  ReturnLink() {     y=getFormWarpRequest().elements["cv.id"];     // if the report is running from reportStudio or the Portal objects are different     if(y.value == "RS")         oCVRS.rvMainWnd.executePreviousReport(-2);     else         oCV_NS_.rvMainWnd.executePreviousReport(-1); } --< /script> --< A HREF="#" onClick="ReturnLink()"> 3. Add HTML item with --< /a> after Back Button. Result: Now using Button, you can go back to previous page in all cases.