2

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.

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

5 Answers 5

1

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.

12
  • 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. Commented Jan 26, 2012 at 1:57
  • @octopus: That's true. My only advice might be to copy the links into a text field.
    – Stu Pegg
    Commented Jan 26, 2012 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>" Commented Jan 26, 2012 at 18:24
  • @octopus: It should display correctly if you put the link outside the div tag.
    – Stu Pegg
    Commented Jan 27, 2012 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. Commented Jan 30, 2012 at 23:47
1

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?

0

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'/>")
2
  • 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. Commented Jan 25, 2012 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. Commented Jan 26, 2012 at 0:03
0

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.

0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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