Skip to Content
Author's profile photo Former Member

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

Assigned tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mahboob Mohammed
      Mahboob Mohammed

      Rogerio,

      This is great, appreciate your effort!!!

      As you know, there are 6 different available options in the left panel:

      1. Document Summary
      2. Report Map
      3. Input Controls
      4. Web Service Publisher
      5. Available Objects
      6. Document Structure and Filters

      How about a script that makes Input Controls (#3) to be selected by default in that left Panel?

      Thanks,

      Mahboob Mohammed

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      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

      Author's profile photo Mahboob Mohammed
      Mahboob Mohammed

      Great! I see it Rogerio. Learning a lot from you. 🙂

      Thanks,

      Mahboob Mohammed

      Author's profile photo Roopa Puranik
      Roopa Puranik

      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

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      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

      Author's profile photo Former Member
      Former Member

      Anyway to set an input control value via javascript?

      Author's profile photo vsenni senni
      vsenni senni

      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

       

      Author's profile photo Former Member
      Former Member

      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

       

       

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Raitis Skrastitis
      Raitis Skrastitis

      More Javascripts wich works on webi 4.2 SP8

      • “Back button” (not webi undo button, but google chrome back button):

      <button onclick=”goBack()”>Go Back</button>

      <script>
      function goBack() {
      window.history.back();
      }
      </script>

      • “go to next report”

      <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) – …

      Author's profile photo Mahboob Mohammed
      Mahboob Mohammed

      Hi Raitis,

      Quick question: Does the "Back Button" here reset any Input Control selections we make?

      Thanks,
      Mahboob Mohammed

      Author's profile photo Raitis Skrastitis
      Raitis Skrastitis

      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. 🙂

      Author's profile photo Mahboob Mohammed
      Mahboob Mohammed

      Thanks for the response. But, reopening the report is not going to work and the report is set to refresh on open.