Tuesday, April 27, 2010

Dynamically Change Style for OBIEE

The most common requirement in OBIEE is to do branding of the portal i.e to remove Oracle Dashboard logo at the top change colors etc etc....


All this is done by changing the image files and style sheets etc , there are many blogs on this and its also documented in the OBIEE Bookshelf
What I am going to cover here is how to set a different style dynamically for a user or group of users as this may be a requirement at places where there are multiple entities in a corporation who share the BI Enterprise infrastructure

For the sake of this blog lets assume that we want to dynamically change the style based on the User who logs in

1. Create a table with 2 columns UserId, STYLE_GRP

2. Insert the names of the folders you create for the different styles for example under D:\OracleBI\web\app\res\ you created folders s_GRPA, S_GRPB, sk_GRPA & sk_GRPB ( you can copy the s_Oracle10 and sk_Oracle10 folders and modify the images and style sheets as required) into this table. You can base it on division instead of individual user's and retrieve the division name from some other employee related table

3. Import the table created in step 1 in the Physical layer

4.Now open the RPD and create a initialization block in the RPD as shown in image which will retrieve the STYLE_GRP column into a STYLE variable from the table created in step 1 on the basis of :USER variable ( make sure that this block runs after authentication/authorization block )



4. close the RPD file restart the BI server (assuming you have created the block while you were online)
5. Its done ( i cant believe its that easy :-) ) now when ever a user logs in a style will be set dynamically. The STYLE variable is un-documented but it works

1 comment:

  1. Sweet!

    Great to see you blogging Amar!

    Regards

    John
    http://obiee101.blogspot.com

    ReplyDelete