Showing posts with label Images. Show all posts
Showing posts with label Images. Show all posts

Wednesday, June 29, 2011

Add image to custom list with calculated / conditional column.

This is the method, I followed to achieve – add image to custom list with calculated / conditional column.


Following is the result list (check Status Icon column)

  • Diff is a calculated column based on Col1 and Col2
  • It compares values of Col1 and Col2 , if Col2 > Col1
    Diff gives us “1″ and if Col1 < Col2 then it gives us “0″
=IF(Col1<=Col2,”1″,”0″)   is the formula I have used

  • My AIM is to get “Green” signal when Diff = 1 and “Red” when Diff = 0
  • Here I have used KPI icon but we can use any image.
  • Download following images on your desktop 

  • Navigate to your site > Picture Libraries
  • Select Shared Pictures > Upload > Browse
  • Select icon image file and upload it to the Share Pictures library
  • Click the icon image displayed in the Share Pictures library.
  • Click the Preview image displayed on the next screen to view the image itself.
  • Copy the Image URL
  • Navigate to the List you want to have the icons displayed in.
  • List Settings > Create column
  • Provide Following details for the column
  • Column name – Status Icon
  • Column Type – Calculated (calculation based on other columns)
  • The data type – Single line of text
  • Add it to default view
  • This is the conditional “IF” formula I have used 

After adding above formula list will look like

  • And finally to convert HTML DIV tag to image we have to add following JavaScript which will call the image from the Shared Picture and display it column.
  • Add following JavaScript to Content Editor Web Part after List.
Found following script from
http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html
to write HTML in to calculated column and convert HTML tag to IMAGE
 
Make sure to add this script in CEWP after list.
Feel free to reach me in case of any doubts.

Saturday, March 26, 2011

Icons are missing from Project Tracking Workspace Template in SharePoint 2007


 This is a global issue and I am very surprised that do not get any solution on internet.
When we create a site using Project Tracking Workspace template (Fantastic 40), following ICON images are missing from the site

It shows  red cross icon instead of following icons.
.


List Icons:

itpwscom.gif  
itpwsris.gif 

Site Feature Icon:

PwsCollab.gif    


Resolution

Download missing icons from internet and add them into images folder on server

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES folder

After which list and feature looks like