Today, let’s see how to show the progress of your tasks in SharePoint:
We’ll rely on this method: using calculated columns to write HTML. Easy, and entirely done through the SharePoint UI.
The [% Complete] is a default column in tasks lists. We just need to add – in a calculated column – the formulas for this specific use case. Here they are:
– Progress Bar:
=”<DIV style=’background-color:blue; width:”&([% Complete]*100)&”%;’> </DIV>”
– Progress Bar 2:
=”<DIV style=’background-color:red;’><DIV style=’background-color:LimeGreen; width:”&([% Complete]*100)&”%;’> </DIV></DIV>”
Note: the character is mandatory to make this work in Firefox.
If you are looking for other colors, here is a very good reference:
http://www.w3schools.com/html/html_colornames.asp
Have just found your blog through EndUserSharepoint.com. Some really good, unique content you have here. Thanks for sharing and please keep it up!
Thanks,
Greg
Just tried to copy and paste the HTML of both progress bars into a calculated column, and what I get displayed is just the formula, and not the progress bar as it shows above. Am I missing something here?
Erich: the formulas themselves do nothing, as you have experienced. You have to add the script (see the reference to the method in the above article).
On this site I have several articles like this one, where I just point to the original article where the script is published.
Pingback: Another example of progress bar « Path to SharePoint
How can I do conditional red, yellow & green coloring? Can’t I just do a nested IF statement?
I’m trying to figure out the syntax, but I’m stumped. I’d like the bar to move and change color, all based on the value of the % Complete column.
Owen: as this topic is very popular, I am going to publish a third article on progress bars. I’ll include your use case.
There are various ways to apply conditional formatting. Using nested IF statements is the standard way. When applicable, I prefer the CHOOSE function which is lighter. Sometimes, you can also use math formulas as a workaround.
I suggest that you check out the following posts (the first one uses the CHOOSE function):
https://pathtosharepoint.wordpress.com/2008/09/01/apply-color-coding-to-your-sharepoint-lists/
https://pathtosharepoint.wordpress.com/2008/09/29/another-example-of-progress-bar/
Pingback: Coming soon: more examples of progress bars « Path to SharePoint
Pingback: Progress bar + color coding « Path to SharePoint
Pingback: The “HTML calculated column”: stay tuned! « Path to SharePoint
Christophe,
How can I get the percent complete in sub-tasks of a major task? Basically, I have “Issue A” and there are 10 sub-tasks. If seven sub-tasks are complete, resulting in “Issue A” being 70% complete – how do I “roll-up” that percentage and then use the calculated columns above to display overall status of “Issue A”.
I’m guessing another calculated column?
Thanks,
Brian
Brian, how do you build the task hierarchy in your list?
SharePoint works by entry (row), and calculated columns won’t allow cross-row calculations.
Hi Christophe
Your article on progress bars for tasks list was exactly what I was looking for – thanks.
However, I have added your script to the source editor of a new content editor web part on the same web page as the list; and your html to a new calculated column Progress, and it does not work.
The Progress column displays as follows:
% Complete Progress
10%
40%
100%
I am using the Project Task list template.
Any suggestions?
Thanks in advance
Jeff
Jeff: first double check your formula (do not copy/paste directly from my post because of text formatting issues), and see if this troubleshooting page helps:
https://pathtosharepoint.wordpress.com/2008/11/01/troubleshooting-your-html-calculated-column/
Hi christophe
Have checked the formula – retyped etc and also read through /tried all the potential fixes in the trouble shooting.
I also tried a different (but similar solution) from someone else: http://blog.ray1.net/2008/01/enabling-html-andor-images-in.html
But no success, the formula runs (i.e. calculates the width % from the % Complete) but does not generate the html, only shows the html code as written in the formula.
Do you think it is because of permissions on Project Tasks lists? the Sharepoint features?
I really have no idea why it is not running. Any help would be greatly appreciated
Jeff
Jeff: send me your formula, and a screenshot of your page in edit mode:
Christophe@PathToSharePoint.com
No worries – have found the error – positioning of content editor web part on page.
Doesn’t work if not below list.
Had it above / to the side etc. Thanks for script and help.
Do you think it would be better to use: http://blog.ray1.net/2008/01/enabling-html-andor-images-in.html
and change the xml file?
Jeff
Perfect :-). btw this is mentioned in the troubleshooting page.
I just discover the above post, and the idea is very similar to mine, except that it’s done on the server side. I don’t know how reliable it is – one of the comments reports an issue.
My blog is mainly for people who don’t have access to the server, and for whom that method is not an option.
Thanks for the help – some great stuff you have done. Looking into your events stuff now – really impressed.
You wouldn’t know anything about summarizing items in a list would you?
e.g. recreate “dashboard” on change request management template (under project management section).
i.e. Can you create a calculated field in one list that summarizes the records from another list?
I am guessing that since you can link multiple lists by lookup, you should be able to summarise them?
Hi,
I tried the above but instead of the progress bar, it displays the html text in the column.
Should i do some other setting?
Thanks
Neeta, follow the links mentioned in the post for more details. In particular see the troubleshooting page:
https://pathtosharepoint.wordpress.com/2008/11/01/troubleshooting-your-html-calculated-column/
It is working now!!!
Thanks a lot for the help and sharing such a wonderful port..
Pingback: Online Workshop – Easy Tabs for Project Dashboard « Path to SharePoint
Pingback: SharePoint Wednesday CodePlex Roundup #2 - Fear and Loathing
Pingback: SharePoint Wednesday CodePlex Roundup #2 | I love .NET!
Pingback: HTML Calculated Column and Unicode Graphics « Path to SharePoint
Thanks for the progress bars. I have one issue, when we try to print the page that has the progress bar, it does not display. Any thoughts?
By default printers don’t print background colors, so this is the expected behavior.
One option is to change your printer settings. Or search my blog for other examples of progress bars, including a printable version.
Pingback: Case study: course compliance report (Part II) « Path to SharePoint
I already developed a webpart by using SPGridView.
Now I want to make that web part as CEWP, so that I can put one column as progressbar. Please suggest me
I have huge list containg tasks to do and their status sorted by subgroup.
e.g.
Subgroup Task Status
A Imp. Doc Completed
A Test In Progress
….
B Build a house NotStarted
I would like to create an overview which gives an overview about the progress for each subgroup and if it is possible in a coloured way or visualized.
Completed In Progress NotStarted Total
Subgroup A 2 4 5 11
Subgroup B 4 2 0 6
..
..
..
Do you have an idea how i can manage this in Sharepoint?
Thanks.
On Progress Bar 2: there is always a little green part on the left end even when %Complete value is 0! How can I fix that.
Right, this is because the bar contains at least a space. To avoid this, you would need to include in the formula a condition that completely removes the bar when % Complete = 0.
I am very happy to found this article. I change the approach a bit then everything is working for me.
approach is:
create a calculate column, then put such code, then it computes starts:
=IF(RatePerformance=”2″,”**”,(if([RatePerformance]=”1″,”*”,(if([RatePerformance]=”3″,”***”,(if([RatePerformance]=”4″,”****”,(if([RatePerformance]=”5″,”*****”)))))))))
it works for SP 2010
Hi all, I have a custom list which I have made the above work with as long as I manually type in the ‘% complete’ into each item as the sale progresses. What I wanted to do was run a workflow from SPD to update the % complete box based on a sales stage, triggered when a item is created or changed. It works the first time I run the WF (compares field, then updates % field in current item, with various additional ‘else if conditions set up for each sales stage, updating the % field). – this could be completely the wrong approach, so please advise. It all falls over when the sales stage is changed, giving an error message, something like ‘the changes made conflict with changes made by a current user’
Any help appreciated as I am hoping this is common or obvious to someone with a brain
Thanks, Ben
Ben, this is obviously not linked to my code. Maybe try to post your question in a forum, like SharePoint on Stackexchange for example.
Thank you so much. Easy to use!
when i posted your formula in calculation based column formula it shows only in task list view. no blue color visible. i think i have to add a cewp in that page and a script to show color .. i could not found that script. please give me link the script that will work on this post.
If I modify the view and add ‘group by’, the progress bars show the formula and not the colors.
eg. Lets say Tasks 1,2,3 are in “Stage1” Tasks 4,5,7 in “Stage 2”. When I group by “Stage” I cannot see the colors.
I am guessing it has to do with the script.
Any help appreciated.
Thanks,
-Deepti
This is one of my oldest post… Read through the blog and you’ll find more recent versions that work in your case, for both SP 2007 and SP 2010.
Pingback: A progress bar for your tasks list « AmitP Tech Blog
This very nice, thank you! Stumped until I put DWP below my data view. Is there a way to stack more than 2 colors? So less of a progress bar than a timeline?
Sure! Search my blog for Gantt and you’ll find an example of this same technique used with dates. This should be a good starting point.
I have Sharepoint 2007 and it not work for my. I create a new List, add a column type number and check the View as percentage, add a column Calculated. Enter the value Title, (20%) in the field numeric and Progress Bar 1 example in the Calculate field. The item show the value and the text script. I Edit the page, add the Web Part Editor Content and paste the Script in the Source code editor, when close the edition mode, this no read the script in the calculated field.
Some help, please.
Leo, did you place the Content Editor Web Part below the view?