SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how can i force sharepoint2007 (MOSS) to interpret HTML code instead of showing it?

I have a column which calculates a yes or no (depending on other columns) within a HTML (i want to show images too). This column is not interpreted by sharepoint. HTML is shown in the column plain.

What can i do to solve this?

share|improve this question
    
Since SP2010 you can also add JavaScript in Calculated Columns (set to datatype=Number) All pros and cons at viewmaster365.com/#/How – Danny Engelman Oct 14 '15 at 11:49
up vote 7 down vote accepted

elcapitano, my tutorial should work:

http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/

A couple notes:

If it doesn't work, feel free to share your HTML string (calculated column output) and I'll take a look.

share|improve this answer
    
after working on the troubleshooting page, it worked! Thanks!!!! Anyway i think i have to develop a system-wide function which allows to display html. – Anonymous Sep 27 '10 at 8:08
    
Please provide a summary for the answer you are linking to. – Nacht Sep 23 '14 at 0:56

If you are developing a DataViewWebPart, you can force sharepoint to render the HTML as opposed to displaying the raw text by using disable-output-escaping set to yes.

share|improve this answer
    
Thanks for your idea. If it is possible, i want to solve this without coding. I tried the tutorial at blog.pathtosharepoint.com/2008/09/01/… by inserting Javascript, but it wont work. – Anonymous Sep 24 '10 at 12:23

If you are bound to using a ListView Webpart (OOTB web part), then you can use Christophe's Text2HTML script. Elaborating on James's answer, you can also look at Marc Anderson's DVWPCalcHTMLColumn XSLT to do the heavy lifting.

share|improve this answer

We've recently released a free HTML Calculated Column; it acts just like a calculated column, but won't escape HTML:

Pentalogic's SharePoint HTML Calculated Column

Disclaimer: I work for Pentalogic; on this project actually. Oh, and I'm afraid you have to sign up for our newsletter, but that isn't a bad trade (in my unbiased opinion). :)

share|improve this answer
1  
This is very nice and works without you knowing much code - just a teensy bit. – bgmCoder Oct 30 '12 at 15:34
    
Thanks. If anyone needs help with the calculated column formulae, we also have a cheatsheet on our site. – Stuart Pegg Oct 30 '12 at 18:12
    
Nice work @StuartPegg , it does the work perfectly. First I tried the JavaScript-way, it's only 2 lines with jQuery after all. But the asynchronous loading and ExpGroupRenderData (and ExpGrou...) didn't want to play along. – eirikb Nov 12 '12 at 10:02
    
@eirikb: Yeh, the 2010 list view AJAX is a mess. It gets worse when you add paging and/or web part auto-updating. Thankfully HTMLCC didn't need these fixes, although Highlighter did. :/ – Stuart Pegg Nov 12 '12 at 10:34

By far the easiest method to do this is to simply set the "data type returned from this formula" setting on your column to be "Number".

Against all logic, this interprets your formula as HTML. I'm not sure if this works in 2007, but it certainly works in 2010 and 2013. Since there are 10,000 views on this topic and very few up votes, I'm guessing this is a much better answer for the wider community than any of the answers given.

share|improve this answer
1  
Brilliantly simple and so typical of Msft's leaky programming. – matt May 22 '15 at 2:41
    
true. thanks for the upvote, really hoping more people use this solution and less people use the others... – Nacht May 22 '15 at 4:09
    
Tremendous - nifty workaround until I can get SP Designer configured – Graham Gold Jul 16 '15 at 19:45
    
Since SP2010 you can also add JavaScript in Calculated Columns (set to datatype=Number) All pros and cons at viewmaster365.com/#/How – Danny Engelman Oct 14 '15 at 11:47
    
"really hoping more people use this solution" yes, so that if this undocumented 'feature' is patched in SharePoint 2016 or whatever, all those painstakingly built HTML columns will be useless. good idea! – underscore_d Oct 20 '15 at 13:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.