COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: raven911 on 09 Jan 2007 01:09:44 AM

Title: Hide Toolbar Items for one single Report as PDF!
Post by: raven911 on 09 Jan 2007 01:09:44 AM
Hello,

in CRN it was possible to add an HTLM Item with :

<script language="JavaScript">
<!-- Begin

// Don't touch the following line
var buttons = new Array();

// Comment out (//) any of the next 9 lines that you DON'T want hidden
buttons.push("report_output");
buttons.push("report_view");
buttons.push("email_report");
buttons.push("run");
buttons.push("html");
buttons.push("pdf");
buttons.push("excel");
buttons.push("CSV");
buttons.push("xml");


// NO NEED TO MODIFY ANYTHING BELOW THIS LINE
// ==========================================
// hide report toolbar buttons
function hideToolButtons() {
   var x = document.body.getElementsByTagName("img");
   for (var i=0; i<x.length; i++) {
      if (x.parentNode.className == "toolbarButton" || x.parentNode.className == "toolbarButtonPressed") {
         var state = checkButtonList(x.src);
         if (state) {
            x.parentNode.style.display = "none";      
         }
      }
   }
}
function checkButtonList(src) {
   for (var i=0; i<buttons.length; i++) {
      if (src.split(buttons).length > 1) {
         return 1;
      }
   }
   return 0;
}

hideToolButtons();

// End -->
</script>
Then the Buttons where gone if the Report was executed.

What changed in Cognos 8?

Thankys for Help.