Posts

Showing posts from March, 2013

How to inject javascript into a Webi report

Image
Well it's quite easy! Let's say we want to display a message to the user every time he opens the report. Step 1 The javascript is easy Step 2 We open the document and add a blank cell somewhere in the report Step 3 With the blank cell selected we go to Properties --> Display --> Read cell content as... and select HTML. By doing this we tell BO to treat whatever we write inside the blank cell as HTML. By default it treats it as it was simple text. Step 2 and 3 Step 4 We select the blank cell and write to the Formula Editor: <script type="text/javascript">alert("Hello injection!!!");</script> Step 5 Then we press the validate button and save the report. Step 4 and 5 Step 6 Open the report (view) and the message we wrote in javascript appears! Aesthetic Tip Select the blank cell and remove the borders in order to make it "invisible" to the user's eye.