I need to change the hyperlink colour

Hi,

I am using opendocument function in webi Report and it shows as hyperlink.

Now I want to show the diffrent colour for visited and unvisited hyperlink.

Like when user open the report at that time hyperlink should show violet
colour and once he click on the link the colour should change to red.

Please let me know how to do this.

Thanks in advance. :hb:


Kajal :us: (BOB member since 2006-09-08)

Hi Kajal,

You could try something like the following (it works for me - on Webi 6.5), and it “should” work for you too.

Create a blank cell somewhere on your report page (near the top would be a good place). Put the following code into the cell:

="<STYLE type='text/css'>A:link {color: #EE82EE;} A:visited {color: #FF0000;}</STYLE>"

Then make the text colour white, set the properties of the cell to “Read as: HTML”, and then make the cell as small as possible (to effectively hide it).

The above code is part of something called Cascading Style Sheets (CSS), and it tells the browser to render all A (Anchor) tags (eg. ) with the attributes specified. In this case we are just telling it to use the color #EE82EE (violet) for the standard link, and #FF0000 (red) for a visited link.

You could use colour names, but I believe these are being deprecated in future versions of CSS. Do a search on the 'net for “HTML color picker” though and you will get results that should allow you to select a colour and it will give you the RGB hexadecimal value.

Another useful addition to the above code is “text-decoration: none;” which removes the underline from a hyperlink.

e.g.

="<STYLE type='text/css'>A:link {color: #EE82EE;} A:visited {color: #FF0000;} A:hover {color: #EE82EE; text-decoration: none;</STYLE>"

Good luck, HTH

Pete


Peter Hughes :uk: (BOB member since 2005-11-21)

Thanks Peter,

That is pretty cool that you can include cascading style sheet instructions right in the in the cell. I was able to put that trick to good use. I am on XIR2 SP1 so technique works in that version as well.


bbenishe (BOB member since 2002-09-03)

Well it’s not just CSS that you can include in a cell. Any cell that has the “Read as HTML” attribute, you can include pretty much any client-side technology (Javascript for instance), and I dare say that if your web-server was so configured, that you could also include server-side technologies … I’ve only really scratched the surface with this. I mean I tried to include some Javascript in a cell that would hide tables, but for some reason, the placement of the DIV tags around the tables went awry for reasons best known to the Business Objects HTML render-engine!? So it appears to have it’s limits, but it can also prove to be very useful though :wink:


Peter Hughes :uk: (BOB member since 2005-11-21)

Hi Peter,
i am working on the open document the default colour for the hyperlink is blue . i just want to change the default colour to any other colour. is there any way i can change the colour of the text.

thank you ,
varun


malyalavarun (BOB member since 2006-07-01)

The default colour for visited/unvisited links.
[list=1:58c99e50ad]
[:58c99e50ad]Open/Create document
[
:58c99e50ad]Turn on View Structure
[:58c99e50ad]Click somewhere in an empty part of the document
[
:58c99e50ad]Go to Properties > Appearance
[*:58c99e50ad]Change default colours
[/list]

I hope this helps.


wahey :netherlands: (BOB member since 2007-05-31)

Hi Peter,
Thank you for the replay.
in the properties whenever i select Read cell content as HYPERLINK the default colour is changing to blue.if i change in the appearance default colours also the default hyperlink BLUE colour is not changing.

thank you,
varun


malyalavarun (BOB member since 2006-07-01)

It does at my end.


wahey :netherlands: (BOB member since 2007-05-31)

Did you save the report to infoview and then check ? Query Panel may not show these Changes directly


Shobhit_Acharya (BOB member since 2005-08-11)

I’ve not checked this, but I’m assuming that the colours are defined by the browser (if not specified by the HTML generated when publishing a webi report).

So that’s why I tend to use the CSS route for changing colours (amongst other things).

To change hyperlink colours I would place a cell somewhere suitable on the report page and add in the following code:


<style type=="text/css">

a:link { color: #RGB; text-decoration: none; }
a:visited { color: #RGB; text-decoration: none; }
a:hover { color: #RGB; }
a:active { color: #RGB; }

</style>

Just replace RGB with the values for your chosen colour or replace #RGB with a colour name in quotes.
The above code will also remove the hyperlink underlining on a standard hyperlink and a visited hyperlink, and I think when you hover the mouse over the hyperlink the underlining will return. If it doesn’t you may need to add in the “text-decoration: underline” into the a:hover bit :wink:

Hope this helps
Pete


Peter Hughes :uk: (BOB member since 2005-11-21)