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.