1

I have some an HTML content column in a SQL Server 2012 database. I want to issue a SQL query similar to:

select name, HtmlContent from table

and have the HTML rendered in the result set, and not as HTML tags.

I do not have reporting services.

I do have Excel with a data query features, so possible Excel could render the Html?

Would appreciate any advice to render this HTML column as part of a query.

Thanks

SamJolly
  • 6,347
  • 13
  • 59
  • 125
  • 1
    Take a look at: http://stackoverflow.com/questions/9999713/html-text-with-tags-to-formatted-text-in-an-excel-cell – Eli Algranti Aug 26 '16 at 00:45
  • I did see that, but I was not keen on writing VBA. I was hoping to use the built-in database query connector and any built-in Excel feature that could format the HTML tag content to rendered HTML – SamJolly Aug 26 '16 at 00:49
  • 1
    How would the database "render" HTML. The database can at most return valid HTML as the data in one of the columns, which according to your question is already the case. Rendering is done on the client alone. You need a client that can render HTML, i.e. a browser. Excel itself does not have html rendering capabilities (to my knowledge) but it can embed an Internet Explorer rendered page inside a cell using COM. Which is what that bit of VBA is doing. – Eli Algranti Aug 26 '16 at 01:42
  • 1
    Looking at the VBA code again I the HTML support would not be too extensive since the resulting content is the same as a copy paste operation from a webpage to Excel (i.e. only basic formatting). How complex are the HTML files you want to display in Excel? – Eli Algranti Aug 26 '16 at 01:48
  • Ok, I think I am understanding now. Basically I get the raw data including HTML Tag content into Excel, then create a VBA Macro which, using the IE COM object, renders the relevant HTML cell. – SamJolly Aug 26 '16 at 12:53

0 Answers0