Monday, February 15, 2010

OBIEE Chancing CSS style on the fly

One of our customers wanted to see some suggested CSS changes on the fly on actual reports. The wanted it on the production machine…

First we copied the Demo file to a new folder on the OC4J webserver:

image

On the demo report we added a static textbox:

image

Put in the reference to the alternate stylesheets:

<link rel="stylesheet" type="text/css" title="Standard"
    href="res/s_oracle10/b_mozilla_4/views.css">
<link rel="alternate stylesheet" type="text/css" title="Red"
    href="res/Demo/views2.css">
<link rel="alternate stylesheet" type="text/css" title="Green"
    href="res/Demo/views3.css">
<meta http-equiv="Default-Style" content="Standard">

If you now open the report in FireFox and goto view => page style

image  (sorry only got the Dutch version installed)

And select the style you want to demo:

image  = Default

image = Red

image = Green

Yes this trick will only work in FireFox (View | Page Style), Opera (View | Style), Konqueror(View | Use StyleSheet), Workarounds for IExplorer are widely spread on the net. Haven’t found it in Chrome Yet

Till Next Time

3 comments:

Siddhartha said...

Thanks!!
But I guess we often need to change styles/skins on the fly based on the users logged in (client acquires another company and the users from acquired company need to see logo of their company in the banner until all units get merged completely). You can use SKIN variable to do that.

Amar said...

I have outlined the procedure to dynamically change the style based on session variable here.......

http://obieetipstricks.blogspot.com/2010/04/dynamically-change-style-for-obiee.html

John Minkjan said...

@Amar,

Thanks for sharing!