Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Hi All,

I´ve been posting about the use of Javascript inserted in a WEBI document.

To insert Javascript code into a webi document just drop a blank cell onto your report, copy the code to it and set its "Read content as" property to "HTML".

In this  blog post I´ll show how to hide a button from the interface, in this case, the Save button.

I´m still working on the general guidelines of scripting WEBI through Javascript but I´m trying to publish as soon as a find out something interesting.

This code will hide the Save button (and its colleague, the "Save as") :

<script>

wi=window.top.window[2].window[0]._widgets;

for(i=0;i<wi.length;++i)

{if  ((wi[i].actionId !== null)&&(wi[i].actionId!== undefined))

     if(wi[i].actionId=='saveBtn')

       window.top.window[2].window[0].document.getElementById(wi[i].id).hidden=true;

}

</script>

This is , shortly how it works,

window.top.window[2].window[0] is webiViewFrame, the HTML window of the document,

wi=window.top.window[2].window[0]._widgets;


will get, into wi the list of the widgets of the window (the widgets are, mostly, interactive objects of the interface (like buttons, tabs, etc..)

next step is  to transverse the list looking for the Save button , when it´s found, we set the hidden attribute of its html element.

This was tested in SAP BO 4.1 SP5.

Regards,

Rogerio


1 Comment
Labels in this area