I am publishing today a minor update (v 2.1.1) of the TextToHTML script:
http://www.pathtosharepoint.com/HTMLcc/default.aspx
You’ll find the updated files under the “download” tab.
Why this update?
First, I am responding to comments from readers on the EndUserSharePoint.com blog. Several months ago, Jim Bob Howard posted an example using my method. His post offers detailed step by step explanations, and is very popular. However, a few readers reported issues with the calendar week/day views, which didn’t render the colors in some configurations. The code I posted today aims at fixing this issue.
I am also taking the opportunity of this update to propose two separate scripts:
- a light version, for both SharePoint 2003 and 2007, that applies the rendering to displayed items only.
- a full version, SP 2007 only, that applies the rendering to displayed and hidden items (grouped views, preview pane, etc.). Be aware that this version encapsulates some of the SharePoint OOTB code.
Tell me again, what is this “HTML Calculated Column”?
If you are an end user, the HTML Calculated Column is a simple yet powerful method that allows you to enhance your SharePoint sites. Even if you don’t plan to use it, you should at least be aware of its capabilities. It many situations, it can replace or even do better than other SharePoint options, like the Data View Web Part, Excel Services or the KPIs available in MOSS. To give you an idea of what you can accomplish, take a look at these examples:
- indicators for lists
- color coded calendars
- KPI roll-up
- some other applications…
For more explanations, read the original article.
To be fair, the method also has its flaws. It leverages the OOTB calculated column, but also relies on a client side script to render the HTML on the page. If you don’t feel comfortable with the “hack” part (TextToHTML script), note that you can avoid it if you use the method with a Data View Web Part, a Content Query Web Part (see above link: KPI roll-up), or an XML source (RSS, URL protocol, Web Service).
Why two different file formats, .dwp and .txt?
I am releasing the code in two formats: Web Part (.dwp) and text (.txt).
The .dwp file is for your convenience, if you only use the method sporadically, or for the first time. Simply import the Web Part to your page and you’re good to go. It is just a Content Editor Web Part containing the script.
If you plan to use the method on a regular basis, you should grab the text file instead: store the code in a central location and point to it. This will greatly facilitate future updates. For more details on this “best practice”, read this article.
A couple reminders
- Remember that the Text to HTML script must be placed below the lists you need to modify.
- The HTML you create via the calculated column must follow the HTML standards. For example for calendar views you’ll need to use inline elements (“span” for example), not block elements (like “div”).
What’s next?
I am currently working on version 3 of the script, which will make the method work on column filters, and headers of grouped views. Some people have already received intermediary versions, and I am waiting for their feedback.
I am also listening to feedback on the current version (big thanks to the readers who shared their findings!). For example, the use of the method in discussion lists, blogs or wikis will require more investigations.
How can I be informed of upcoming releases?
The preferred way is to subscribe to the RSS feeds, either for this blog or for my SharePoint downloads library. If you don’t use RSS, feel free to contact me, and I’ll send you an e-mail when v3 is out.

21 comments
Comments feed for this article
November 19, 2009 at 5:12 pm
Update: SharePoint Color Coded Calendar – PayRoll Schedule | End User SharePoint
[...] The popularity of this technique has made it necessary to drill down a little deeper and make sure everything is working as it should. To this end, Christophe has updated the script to fix a couple of little glitches. You can find the updated resources at Path to SharePoint, HTML Calculated Column: minor update… and some advice. [...]
November 30, 2009 at 2:40 pm
Show Current Calendar Month Items in a Graphed Timeline | End User SharePoint
[...] the techniques Christophe is developing for presenting HTML data in a calculated column, this looks do-able. I like the idea of exposing the information along a timeline to get a quick, [...]
December 1, 2009 at 4:17 pm
Sparklines in SharePoint (part II) – A homemade bar graph « Path to SharePoint
[...] If you haven’t used the “HTML calculated column” method yet, you’ll need to learn it first (it’s really worth it if you are interested in visualization solutions). For the latest information on the HTML calculated column, start with this post. [...]
January 4, 2010 at 1:03 pm
HTML Calculated Column and Unicode Graphics « Path to SharePoint
[...] of these tutorials. For the latest information on the HTML Calculated Column, start with this post… or attend one of our live online [...]
January 7, 2010 at 1:42 pm
KPI roll-up in SharePoint (Part I) « Path to SharePoint
[...] tool for building the visual indicators is my “HTML Calculated Column” method. If you’ve already used it before, you know that it is usually associated with [...]
January 13, 2010 at 12:17 pm
KPI roll-up in SharePoint (Part II) « Path to SharePoint
[...] looking forward to your feedback. I think it is a very convenient implementation of the “HTML Calculated Column”, as it doesn’t rely on a Content Editor Web Part. Also, the method works on both wss and [...]
January 16, 2010 at 6:57 am
Smart TextToHTML « Path to SharePoint
[...] “, you won’t get much from this post. In this case, I recommend that you start with this introduction. In short, the TextToHTML script has two roles: 1/ find HTML strings in a SharePoint page 2/ [...]
April 6, 2010 at 1:56 pm
larry
Good day Christophe,
, I noticed an opportunity. I know you made some improvements from the original script, which are along the same lines so I thought I would give you something to think about for future releases.
I think very highly of you and have the utmost respect and I believe you are on the cutting edge of this technology. While I was playing around with this script (HTMLcc), In fact I dont think I do any development work these days where I dont use this script,
When using the Export function I have noticed that the calculated column of colors or images are in HTML when they reach Excel. I believe there has to be a way to convert this or not convert it when using the Export to Excel leaving the images and color just as they are in the view. I have created macros scripts where color and format are retained when exported to Excel. It’s not an exact match but usable. I also came across a script on Bits of SharePoint for a print webpart (endusersharepoint) that would make a perfect export to excel if it could be retained in the print format.
I know you’re busy, this was just something to think about. Is it possible?
thanks again for all your support
April 6, 2010 at 2:52 pm
Christophe
Larry, how about using the Web Query feature in Excel, directly on the Web page? This would retain the html formatting.
April 9, 2010 at 9:35 am
Wou Emmanuel
Dear Christophe,
In your Calendar demo with Mark, you’ve shown us how to display a form when a mouse hover an item.
Please give us some intruction on doing this.
Emman
April 10, 2010 at 6:54 am
Christophe
Our online presentation was an introduction to the workshops. More information here:
http://eusp-sharepointcalendars.eventbrite.com/
Session 2 will answer your questions.
April 20, 2010 at 1:35 am
Client side scripts: how will they behave in 2010? « Path to SharePoint
[...] it with color coding, animations, and other features. The most popular are the Easy Tabs and the HTML Calculated Column. Let’s review the main challenges and see how we can address [...]
May 28, 2010 at 8:46 am
HTML Calculated Column: solutions for SP 2010 (Part I) « Path to SharePoint
[...] May 28, 2010 in SharePoint 2003, SharePoint 2007, SharePoint 2010, The HTML calculated column, XLV, XSLT List View This series assumes that you are familiar with the “HTML Calculated Column“. [...]
May 28, 2010 at 8:49 am
HTML Calculated Column: solutions for SP 2010 (Part II) « Path to SharePoint
[...] column, XLV, XSLT List View This series assumes that you are familiar with the “HTML Calculated Column” [...]
June 12, 2010 at 9:01 pm
формулы и SharePoint « Sharepoint .BY
[...] И даже есть готовый к использованию вебпарт, построенный по тому же принципу: http://blog.pathtosharepoint.com/2009/11/19/html-calculated-column-minor-update-and-some-advice/ [...]
June 16, 2010 at 9:16 am
HTML Calculated Column: solutions for SP 2010 (Part III) « Path to SharePoint
[...] 2010, The HTML calculated column This series assumes that you are familiar with the “HTML Calculated Column” [...]
June 16, 2010 at 9:50 am
HTML Calculated Column: solutions for SP 2010 (Part IV) « Path to SharePoint
[...] 2010, The HTML calculated column This series assumes that you are familiar with the “HTML Calculated Column” [...]
June 16, 2010 at 9:55 am
SharePoint Kaffeetasse 186 - Michael Greth [SharePoint MVP] - SharePointCommunity
[...] HTML Calculated Column: minor update… and some advice [...]
November 2, 2010 at 6:19 pm
A2life » Showing a list from another SharePoint Site
[...] This “Cross site list Snapshot tool” works pretty well. However, the list “extracted” in this manner can not take advantage of TextToHTML script. [...]
November 4, 2010 at 3:42 am
A2life » SharePointクロスサイトのリスト表示をJQueryで行う
[...] この “Cross site list Snapshot tool” 、使ってみると快適に作動する。 ただし、この方法で抜き出されたリストはそのままではTextToHTML script が使えない。 [...]
February 4, 2011 at 12:38 am
HTML Calculated Column: solutions for SP 2010 (Part IV) « maiomardesouki
[...] series assumes that you are familiar with the “HTML Calculated Column” . Part I: fallback to SP 2007 Part II: edit in SharePoint Designer Part III: deal with [...]