Saturday, February 28, 2015

How to design Cognos interactive reports 13 - Make report element show and hide

Space is very important for interactive reports, as business users will look at data on screen. How to make prompt controls and filters take the least space is a very important topic. We’d like to all prompts and filters be compressed by default. The filter only show detail data when business users click. In a normal situation, it should only show the selected value. This document will demonstrate the idea to report element show or hide. Please see attached report specification for review (version 10.2 with sample Package GoSales)


1
<script language="JavaScript">


var edit1val = new Array();
var edit2val = new Array();
var edit3val = new Array();
var edit4val = new Array();


function Show(promptNum)
{
var promptObj = document.getElementById("UserPrompt"+promptNum);
if (promptObj.style.visibility!="visible")
{
promptObj.style.visibility="visible";
promptObj.style.display="block";
}
else
{
Hide(promptNum);
}
}


function Hide(promptNum)
{
var promptObj = document.getElementById("UserPrompt"+promptNum);
promptObj.style.visibility="hidden";
promptObj.style.display="none";


}


function Submit(promptNum)
{
var promptObj = document.getElementById("UserPrompt"+promptNum);
SetPromptControl('reprompt');
promptObj.style.visibility="hidden";
promptObj.style.display="none";
}


</script>


2
<img src="../pat/images/appCard.gif" alt="" onClick="Show(1); ">


3
<DIV id="UserPrompt1" style="visibility:hidden; display:none">


4.
<img src="../pat/images/appCard.gif" alt="" onClick="Show(2); ">


5.
<DIV id="UserPrompt2" style="visibility:hidden; display:none">


6.
</DIV>


7.
</DIV>

No comments:

Post a Comment