How to perform actions in Webi Intelligence through Javascript
this document will collect scripts that performs actions (click an icon, disable elements and so on) in a WEBI doc, through Javascript.
In order any of the scripts to work, we´ll need to set the Webi preference (under BI Launch Pad view/modify to HTML.
Instructions
1 – Drop a blank cell onto the report,]
2 – Set the cell property Read As to HTML
3 – Copy and paste the text of the script (from <script> to </script>, included ) to the cells formula
The first two will be :
1 – Collapse the Left Panel
<script>
self.top.window[2].window[0]._widgets[77].clickCB();
</script>
2 – Disable the Save button
<script>
self.top.window[2].window[0]._widgets[282].setDisabled(true)
</script>
3 – Reseting ALL Input Controls in a Report
<script>
self.top.window[2].window[0].window[5].iFormResetAllCB()
</script>
Comments and suggestions about actions to be performed will be highly appreciated.
Regards,
Rogerio
Rogerio,
This is great, appreciate your effort!!!
As you know, there are 6 different available options in the left panel:
How about a script that makes Input Controls (#3) to be selected by default in that left Panel?
Thanks,
Mahboob Mohammed
Hi Mahboob,
thanks for your interest and your suggestion. In fact, this is the script in which I´m working at the moment. Hope to solve the last issue with that soon.
At the present moment, I´m abble to , programatically , check an item in a checkbox of a Input Control. The chalenge now is to pass this selection to the server.
PS : I can send a script to reset the values of an Input Control. It´s on the list at the top.
Regards,
Rogerio
Great! I see it Rogerio. Learning a lot from you. 🙂
Thanks,
Mahboob Mohammed
Hello Mahboob,
Did the reset input control script work for you? If so, can you please share the script and what worked for you?
Thanks, Roopa
Hi Rogerio,
Did you ever work out how to send the selection of clicked items to the server? I am trying to make three groups of inputs filters (which have some interdependencies) that are all checkboxes become disabled in response to a selection in another filter. I can achieve this but when I attempt to change filters programatically I can only get the first change sent to the server as the main report with the source javascript in it is reloaded and despite the buttons being visually checked the report is only filtered for the first checkbox I activate.
Nigel
Hi Nigel,
I was able to do something similar through Input Controls. Create an Input Control, set the desired values and send it to the server.
I am out of work now, don´t have access to my documentatios.
As soon as I came back I´ll send it to you.
Regards,
Rogerio
Anyway to set an input control value via javascript?
Hi Rogerio Plank,
I am following your Post always
I have a requirement to hide and show the report block based on the Element Link  unfortunately i promised to the user its achievable.
I have 4 Table Block.
Table 1 : Master table 1
Table 2: Child Table of Master table 1
Table 3: Master table 2
Table 4: Child Table of Master table 3
Requirements
When the user Click Table1 then Table 2 should enable.
When the user Click Table 3 then Table 2 Should Hide and Table 4 should enable .
The above one I achieved it based on the below logic. I have written this logic in Table properties (Hide when the formula is true)
Table 2 = If ((Pos(ReportFilterSummary();"Table 4") = 0) ;"Hide" ; "Show") ="Show"
Table 4 = If ((Pos(ReportFilterSummary();"Table 4") = 0) ;"Hide" ; "Show") ="Hide"
Now if the user Click Back to Table 1 then Table 2 should bring back and Table 4 should hide. But I couldn't able to achieve this
Can you please help me.
I tried with your approach creating a RESET Button, but its not working out for me
Hi Rogerio,
I am trying to create a reset button to reset all the input controls and I tried the script and all the steps you provided and it does not work. When I click on the cell nothing happens. The formula in the cell parses OK though.
We are on BI 4.2 SP3.
Thank you so much.
Roopa
Hi Rogerio,
even Im not able to use the code, it isnt working(nothing happens on click on the button). Can you help us what could we be doing wrong.
Followed your steps as is though...
Below is the button logic and changed the type as HTML.
<!DOCTYPE html>
<html>
<head>
<script>
function reload()
{
self.top.window[2].window[0].window[5].iFormResetAllCB();
}
</script>
</head>
<body>
<input type="button" style="cursor:pointer"Â value="Refresh" onclick="reload()"/>
</body>
</html>
Thanks,
Pavan
More Javascripts wich works on webi 4.2 SP8
<button onclick=”goBack()”>Go Back</button>
<script>
function goBack() {
window.history.back();
}
</script>
<button onclick=”gotoReport(1)”>Next report</button>
<script>
function gotoReport(n) {
this.parent.selectReport(n);
}
</script>
gotoReport(0) – first report
gotoReport(1) – second report
gotoReport(2) – …
Hi Raitis,
Quick question: Does the "Back Button" here reset any Input Control selections we make?
Thanks,
Mahboob Mohammed
I can say “No”. This function is button on your browser – not so good case, but maybe some one helps. Right now I’m searching 1)undo 2)export 3)input control reset 4)go to next and previous page buttons.
And about reseting, I have some cheating solution - make hyperlink wich open(reopen) report in current window. 🙂
Thanks for the response. But, reopening the report is not going to work and the report is set to refresh on open.