Thursday 14 June 2012

Hiding/ Removing the Header Banner

In OTN forum got the issue-https://forums.oracle.com/forums/thread.jspa?threadID=2401802&tstart=0
To hide the header banner of the application we can use custom javascript to override the default properties. This can be used in cases where we need to embed a dashboard pages/ tabs inside another page/ tab.
We need to use the below code inside a static text with HTML enabled. Remember this piece of code needs to be added in all the pages within the static text, so as to take the affect.
Before the javascript in the page-




<script type="text/javascript">
var tds = document.getElementsByTagName('table');
for (var td = 0; td < tds.length; td++) {
if (tds[td].className != 'HeaderTopBar' && tds[td].className != 'HeaderSecondBar' ) {
continue;
}
if (tds[td].className == 'HeaderTopBar') {
//alert (tds[td].className);
var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}
if (tds[td].className == 'HeaderSecondBar') {
//alert (tds[td].className);
var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}
}
</script>


Or also try the below code-

modified 'HeaderSecondBar' to 'HeaderSecondBar HeaderSecondBarPadding'

<script type="text/javascript">
var tds = document.getElementsByTagName('table');
//alert(tds.length);
for (var td = 0; td <= tds.length; td++) {
if (tds[td].className != 'HeaderTopBar' && tds[td].className != 'HeaderSecondBar' ) {
continue;
}
if (tds[td].className == 'HeaderTopBar') {
//alert (tds[td].className);
var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}
if (tds[td].className == 'HeaderSecondBar HeaderSecondBarPadding') {

var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}

}
</script>


After the javascript in the page-



In cases where we need to remove the links from the Header banner, then we need to find the
saw.sessioninfos.xml in <MiddleWareHome>/Oracle_BI1/bifoundation/web/msgdb/common
and replace the below codes accordingly.
You should set the following entries from "true"="false"
<gdexpression id="hdrLinkCatalog" expr="true" />
<gdexpression id="hdrLinkOpen" expr="true" />
<gdexpression id="hdrLinkAdvanced" expr="true" />
<gdexpression id="hdrLinkHelp" expr="true" />
<gdexpression id="hdrLinkHome" expr="true" />
<gdexpression id="hdrLinkGSearch" expr="true" />
<gdexpression id="hdrLinkNew" expr="true" />
<gdexpression id="hdrLinkDashboards" expr="true" />
<gdexpression id="hdrLinkSettings" expr="true" />
Restart the BI Services and clear the browser cache
This will affect all users.

-----------------------------
As suggested by one of the user in OTN forum-

-- The above code works in Firefox, but does not work in Internet Explorer (IE 8) because of two issues.
-- td <= tds.length should be td < tds.length
-- IE uses class HeaderSecondBar HeaderSecondBarMargin
-- The following code will now work in Firefox, IE, Chrome, and Safari

<script type="text/javascript">
var tds = document.getElementsByTagName('table');
//alert(tds.length);
for (var td = 0; td < tds.length; td++) {
if (tds[td].className != 'HeaderTopBar' && tds[td].className != 'HeaderSecondBar' ) {
continue;
}
if (tds[td].className == 'HeaderTopBar') {
//alert (tds[td].className);
var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}
if (tds[td].className == 'HeaderSecondBar HeaderSecondBarPadding' || tds[td].className == 'HeaderSecondBar HeaderSecondBarMargin') {
var x = tds[td].parentNode;
//alert (x.className);
x.removeChild(tds[td]);}
}
</script>

2 comments:

  1. I have implemented same kind of small diffrent
    ///
    add script tag
    var bodytag=document.getElementsByTagName('body');
    bodytag[0].style.backgroundColor='white';


    var tds = document.getElementsByTagName('table');
    for (var td = 0; td < tds.length; td++) {
    if (tds[td].className != 'HeaderTopBar' && tds[td].className != 'HeaderSecondBar') {
    continue;
    }
    if (tds[td].className == 'HeaderTopBar') {
    //alert (tds[td].className);
    var x = tds[td].parentNode;
    //alert (x.className);
    x.removeChild(tds[td]);}
    if (tds[td].className == 'HeaderSecondBar') {
    //alert (tds[td].className);
    var x = tds[td].parentNode;
    //alert (x.className);
    x.removeChild(tds[td]);
    }
    }
    var tabletag=document.getElementsByTagName('table');
    for(var i=0;i

    ReplyDelete
  2. Hi

    Thanks for the article, is it possible to show several dashboards in the dashboard tab ?
    to have many dashboards showing in the dashboard tab beside " my dashboard tab "

    please let me know at
    yanal.rsakaji@gmail.com

    thanks in advance

    ReplyDelete

Thanks to Comment
--Add--