By Sveta Yerpilev
SharePoint Technical Consultant
KWizCom Professional Services – www.kwizcom.com
******
Our work often necessitates creating solutions as we go.
One day I was asked to show the status of the items in a SharePoint list with colors or, in other words, to categorize by colorizing.
The idea was for users to populate the list by choosing the status from a checklist (simple) and then be able to see the color coded status on the homepage automatically (how do you do it?).
This is the solution I came up with:
First I created a list with column labeled “Status” that could get the values “Ready”, “Not Working” or “Not Ready”.
Then I created an additional column labeled - “Status Icon”. I made this a calculated column – each field gets their value according to the value of the “Status” field of same item. This column actually contained links to pictures where the link changes according to the value in the “Status” field.
Here is the formula for the calculated column:
=IF(Status="Ready","pictureLibrary/ready.jpg",IF(Status="Not Ready","pictureLibrary/notready.jpg",IF(Status="Not Working","pictureLibrary/notworking.jpg","Not Working")))
Ok, now we have a link to the right picture, but how do we see this picture on the page?
To do this we need to use the Data View Web Part that is available only in SharePoint Designer, so we must edit the page in the SharePoint Designer to add Data View.
After adding this web part we need to add columns from our list to the web part.
Note - we add the “Status Icon” column ONLY and NOT the “Status” column!
After we do this we need to change the format of the “Status Icon” values to “Picture”. Now we will see all of the values in the “Status Icon” column as images.We can also change the title of the column to “Status”.
Here is how it looks in the end:
Post Script - the scenario detailed here occurred before I learned that calculated fields can contain HTML. Utilizing this option enables us to avoid SharePoint Designer all together although my solution was fairly simple so I suggest picking whatever you are most comfortable with – either way will do the trick!
You can find more information on this subject at this great blog:
http://pathtosharepoint.wordpress.com/category/calculated-columns/
****************************
For more helpful tips and guidelines please visit our blog: http://kwizcom.blogspot.com/ You can try KWizCom add-ons free of charge at: http://www.kwizcom.com/
No comments:
Post a Comment