I'm writing a reports library, and one implementation has will create neat HTML/XHTML report document from entity object. Instead of rendering tags manually (StringBuilder) I could take advantage of built-in .NET classes (if any). In the past I used XmlTextWriter to create plain XML files, but it guess it's not the perfect solution to create HTML document. Could you advise on any classes in .NET that could be used in dll library that would suit my needs better than XmlTextWriter?
Asked
Active
Viewed 945 times
2 Answers
0
There are many ways including formatting and generating html string from code. But there are some class which can validate like HtmlTextWriter
[ http://msdn.microsoft.com/en-us/library/system.web.ui.htmltextwriter(VS.71).aspx ] to generate all of your tags.
You may try this it has many tag generation stuff that may usefull to your instead create manual string html data.

bijayk
- 556
- 3
- 18
0
You can use HtmlTextWriter Class, and here are benefits of using it: Are there any benefits to using HtmlTextWriter if you are not going to benefit from adaptive rendering?.
For simple layout StringBuilder might be faster and easier way to write.

Community
- 1
- 1

Michał Powaga
- 22,561
- 8
- 51
- 62