HTML Calculated Column: minor update… and some advice

I am publishing today a minor update (v 2.1.1) of the TextToHTML script:
You’ll find the updated files under the “download” tab.

Why this update?

First, I am responding to comments from readers on the 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.


24 thoughts on “HTML Calculated Column: minor update… and some advice

  1. Pingback: Update: SharePoint Color Coded Calendar – PayRoll Schedule | End User SharePoint

  2. Pingback: Show Current Calendar Month Items in a Graphed Timeline | End User SharePoint

  3. Pingback: Sparklines in SharePoint (part II) – A homemade bar graph « Path to SharePoint

  4. Pingback: HTML Calculated Column and Unicode Graphics « Path to SharePoint

  5. Pingback: KPI roll-up in SharePoint (Part I) « Path to SharePoint

  6. Pingback: KPI roll-up in SharePoint (Part II) « Path to SharePoint

  7. Pingback: Smart TextToHTML « Path to SharePoint

  8. Good day Christophe,
    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, :), 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.

    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

  9. 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.


  10. Pingback: Client side scripts: how will they behave in 2010? « Path to SharePoint

  11. Pingback: HTML Calculated Column: solutions for SP 2010 (Part I) « Path to SharePoint

  12. Pingback: HTML Calculated Column: solutions for SP 2010 (Part II) « Path to SharePoint

  13. Pingback: формулы и SharePoint « Sharepoint .BY

  14. Pingback: HTML Calculated Column: solutions for SP 2010 (Part III) « Path to SharePoint

  15. Pingback: HTML Calculated Column: solutions for SP 2010 (Part IV) « Path to SharePoint

  16. Pingback: SharePoint Kaffeetasse 186 - Michael Greth [SharePoint MVP] - SharePointCommunity

  17. Pingback: A2life » Showing a list from another SharePoint Site

  18. Pingback: A2life » SharePointクロスサイトのリスト表示をJQueryで行う

  19. Pingback: HTML Calculated Column: solutions for SP 2010 (Part IV) « maiomardesouki

  20. Good day Christophe, It’s been a while since I have harrassed you. Again I am playing with the HTMLcc script. I am trying to inplement this on a grouped view, where the groups titles are converted. I see this did not work or maybe not part of the design. Is this possible, with some changes, to apply this script to the lables or grouped titles of a grouped view?


  21. There is a host of spray tanning products in the market for the
    consumer to decide on if they choose to spray tan at home.
    Tanning requires that you sit, stand or lay still – this
    could get boring. But when this time comes around, insecurities start to pop out
    in even the most confident of individuals.

Comments are closed.