Tuesday, May 11, 2010

OBIEE Remove PDF print option for one dashboard only

Or how to get from:

image

to

image 

add this to a textbox on the dashboard:

[code]

<script type="text/javascript">
    function RemovePDFOption() {

        var tds = document.getElementsByTagName('span');
        for (var td = 0; td < tds.length; td++) {

            if (tds[td].className != 'DashboardFormatLinks') {
                continue;
            }

            //alert(tds[td].innerHTML);
            var tHTML = tds[td].innerHTML;
            tHTML = tHTML.replace("PDF</a>","</a>");
            //alert(tHTML);
            tds[td].innerHTML = tHTML;

        }
    }
    window.onload = RemovePDFOption;
</script>

[/code]

Yeah i know this is very crude (the link is still somewhat hidden there), but if you play around with javascript .replace and indexof you can clean it up even more.

Till Next Time

13 comments:

Andrew said...

@John

Thanks so much for your help. I did have to change:
tHTML = tHTML.replace("PDF</a>","</a>");

to

tHTML = tHTML.replace("PDF","");

but it works! Thanks again!

Rahul said...

hi john, good morning.

I would like to display my dashboard pages as submenu items such as
Folder
|
Dashboard1
Dashboard2-> GL (Dashboard PAges)
AP
AR
Dashboard3->Page1
page2

.....
How can we show this design in main menu page

i.e if user click on dashboard it should display dashboard pages as sub menu items on right side..

Thanks

Rahul

John Minkjan said...

@Rahul,

Bit short on time right now but do a google on JAVASCRIPT DROPDOWN MENU.

regards

John

aravind said...

Hi John,

I had some trouble accessing my reports build using flex. They are running fine when I view them using flash template but when I try to export them to the PDF my data is getting truncated. Please let me know if I need to change any template settings.

Thanks,
Aravind P

John Minkjan said...

@aravind

Can't help you there, i've got no experience with a tool called flex.

regards

John

aravind said...

Thanks John No problem.

Luz said...

Hi, I need to delete a Refresh option, how can i do that?

Andrew said...

@Luz

I was able to get this to work:

<script type="text/javascript">
function RemoveRefresh() {

var tds = document.getElementsByTagName('span');
for (var td = 0; td < tds.length; td ) {

if (tds[td].className != 'DashboardFormatLinks' || tds[td].firstChild.title != 'Refresh') {
continue;
}

//alert(tds[td].innerHTML);
tds[td].innerHTML = "&nbsp";

}
}
window.onload = RemoveRefresh;
</script>

I hope that helps,

Andrew

Andrew said...

@Luz

I was able to get this to work:

<script type="text/javascript">
function RemoveRefresh() {

var tds = document.getElementsByTagName('span');
for (var td = 0; td < tds.length; td++) {

if (tds[td].className != 'DashboardFormatLinks' || tds[td].firstChild.title != 'Refresh') {
continue;
}

//alert(tds[td].innerHTML);
tds[td].innerHTML = "&nbsp";

}
}
window.onload = RemoveRefresh;
</script>

I hope that helps,

Andrew

Mariana said...

@John
Thank you very much! All your posts are very usefull.

Is there any change you have a JavaScript to remove the "Powered by Oracle" image an link? I was ablo to replace the image with a blanck one, but it is still there and so the link.

Thanks!
Mariana

Priya said...

Hi John,
I need to remove PDF print option in the report level as i m using column prompt in my report, i manually add Printer friendly option while creating Dashboard -using Report Links. Need your help.

Thanks
Priya.

lakshmi said...

Hi John,

Your postings are really very helpful,
can you please tell me how to hide the Download to MHTML option from download links on dashbord

Budha said...

How to remove HTML option because I want to keep PDF