How to inject javascript into a Webi report

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.

Comments

  1. Great technique! Is there any way to delay the script execution until after user prompts have been selected?

    ReplyDelete
    Replies
    1. I haven't tried that but I can't think an easy way to do that...

      Delete

Post a Comment

Popular posts from this blog

Convert Outlook EntryID to EwsID Exchange Web Services

ASP.NET entity datasource control error - The metadata specified in the connection string could not be loaded. Consider rebuilding the web project to build assemblies that may contain metadata.The following error(s) occurred. The provider did not return a Provider Manifest instance.

Freeze panes in BO Webi report like Excel