Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working on creating sharepoint dashboard using color coding. I have my custom list created and all of the traffic lights are working based on condition user provides. Following is the basic set up of my list

Program: Single Line Text              

Light 1: Calculated Field                Light1Link: Hyperlink

Light 2: Calculated Field                Light2Link: Hyperlink

Light 3: Calculated Field                Light3Link: Hyperlink

Light 4: Calculated Field                Light4Link: Hyperlink

Screenshot

Now is there a way that when user clicks on those individual lights will get directed to Hyperlink provided in Light1Link, Light2Link, ... Light4Link?

Edit:

To get color coding i have been using a javascript provided in pathtosharepoint.com very close to Sharepoint user ToolKit. Jussi can you please elaborate on you idea of modifying xsl. Just a reminder i am not trying to redirect a specific or a static url. It needs to get redirected according to user input in the fields Light1Link... Light4Link. Also the traffic lights are not an image file they are html. i.e i entered following piece of html in Calculated column named Tech Lights(KPI Lights)

="<DIV style='font-weight:bold; font-size:24px; color:"&[Tech]&";'>•</DIV>"

Which gives me Green light if Status of [Tech] column is Completed, Yellow IF [Tech} is In Progress, and Red if [Tech] is Not Started.

share|improve this question
2  
Please, clarify, what are you using for color coding? Conditional formatting or SharePoint User Toolkit? (usermanagedsolutions.com/SharePoint-User-Toolkit/Pages/…) –  Andrey Markeev Jan 24 '12 at 22:15
    
@omlin: They're using Christophe's solution (edited in from flagged answer). –  Stuart Pegg Jan 25 '12 at 21:55
    
Yep, thanks @StuartPegg for editing that into Octopus' question. –  Kit Menke Jan 25 '12 at 22:31
add comment

5 Answers 5

up vote 1 down vote accepted

I believe the formula you're looking for is this:

="<a href='"&[Link]&"'><DIV style='font-weight:bold; font-size:24px; color:"&[Tech]&";'>•</DIV></a>"

Where [Link] is the name of the column containing your required link.

share|improve this answer
    
Stuart thank you for the help. I applied your code it gave me error "One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas." It looks like [Hyperlink] is not supported by formulas. –  octopus Jan 26 '12 at 1:57
    
@octopus: That's true. My only advice might be to copy the links into a text field. –  Stuart Pegg Jan 26 '12 at 8:35
    
Stuart, i tried text field instead of hyperlink, it looks nice but with one exception All of the lights are turned blue. is it because of text decoration of hyperlink. This is my html ="<DIV style='font-weight:bold; font-size:24px; color:"&Process&";'><a href='"&[Processs Link]&"'>•</a></DIV>" –  octopus Jan 26 '12 at 18:24
    
@octopus: It should display correctly if you put the link outside the div tag. –  Stuart Pegg Jan 27 '12 at 8:42
1  
Yup it worked but i had to name fourth KPI light to KPIDefaultlarge--1.gif for option (4) not completed. I dont why but it worked. That should conclude this question. Now i have dashboard with kpi lights which is set according to status of a project. Users can also click on KPI lights that will forward them to designated address provided my author. Thank You very much for your help Stuart. –  octopus Jan 30 '12 at 23:47
show 7 more comments

Depending on how you create the dashboard, can you modify the XSL of the the dashboard and make a small change to add link tags around the traffic light picture pointing to the hyperlink defined?

share|improve this answer
add comment

In your DIV tags (assuming that's the method you're using) creating the colors, include a unique class or ID name. Use some jQuery to grab all of your divs and wrap with a link. So following octopus example, if I take his and add a unique identifier

="<DIV style='font-weight:bold; font-size:24px; color:"&[Tech]&";' class="&[Tech]&">•</DIV>"

And using jquery you can do something like

$(".Completed").wrap("<a href='url'/>")
$(".InProgress").wrap("<a href='anotherUrl'/>")

or if you want them all to one URL, just give it a more generic class like

class="myLight"

and then one line to wrap the link

$(".myLight").wrap("<a href='url'/>")
share|improve this answer
    
Thank You for your answer David. But how is $(".Completed").wrap("<a href='url'/>") is going to feed value to i.e [Light1] from column [Light1Link]. URL has to be fed from the hyperlink column where user inserts the value. –  octopus Jan 25 '12 at 15:42
1  
my bad, I missed the link is in the list as well... Did you try Stuart Pegg's suggestion? To get the link you could use SPServices to call the list and pull the value, or include the link column, and try using jQuery to hide the column so it's not evident. Very messy, but easier than creating a custom field. –  David Lozzi Jan 26 '12 at 0:03
add comment

Found this article. It solved my problem easy, no javascript at all.

Article

Make your formula i.e.

="<a href='"&[Link]&"'><DIV style='font-weight:bold; font-size:24px; color:"&[Tech]&";'>•</DIV></a>"

and set "The data type returned from this formula is: " to be i.e. number. VOILA

Worked for me.

share|improve this answer
add comment

If you want more flexibility, consider a computed field instead of a calculated field: http://www.threewill.com/2012/07/computed-fields-in-sp-2010/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.