HTML 2 Image

A while ago, I was working on reporting and was very happy with the new HTML options on the RDLC. But, as you might know, these are actually quite limited…

According to Microsoft, these are the supported tags:
<A>, <FONT>, <H{n}>, <DIV>, <SPAN>,<P>, <DIV>, <LI>, <HN>, <B>, <I>, <U>, <S>, <OL>, <UL>, <LI> (http://msdn.microsoft.com/en-us/library/cc645967.aspx)

Which does mean we are missing a lot of possibilities we do have in basic HTML. For this reason, I created a .NET class which accepts an HTML string and converts it to an image. This image could the easily be added to your RDLC columns to be shown on the report.

The Add-In has a property to crop the image (leaving no white borders) and a function “CaptureWebPageBytes”.

The function accepts the string you wish to set into an image. And if necessary, you can say how wide and high your image needs to be.

You can find a test application inside the file to check it out. All source is included.

2 thoughts on “HTML 2 Image

  1. Maybe you want to take a look at cc|formatted documents. It’s a tool where you can use a WYSIWYG-Editor and all this will be printed to a report without using images.

  2. Pingback: HTML 2 Image | Pardaan.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.