Rox Wen
Rox Wen

Reputation: 253

Can the .NET ReportViewer render HTML?

One of my report's text data sources contains some formatting in HTML, just the basic formatting tags such as paragraph, bold, etc.

Can the ReportViewer be made to render the formatted text? If not, can anyone recommend a work-around?

Upvotes: 0

Views: 6340

Answers (3)

Greg Sansom
Greg Sansom

Reputation: 20860

I'm not sure which version you were using, but .NET 4 lets you use html in your reports.

In the report designer, right click on the placeholder and click "Placeholder Properties", then select "HTML - Interpret HTML tags as styles":

enter image description here

Upvotes: 5

Rox Wen
Rox Wen

Reputation: 253

The ReportViewer could not render the HTML formatting natively.

As is mentioned elsewhere on S.O., when it comes to parsing HTML, the Html Agility pack proves to be a great solution. We used it to remove the HTML tags before passing the content over to the ReportViewer.

Easy, free and open source.

Upvotes: 0

Vidar Nordnes
Vidar Nordnes

Reputation: 1364

I don't think that's possible, but you can use the webbrowser control in your form(?) in addition to the reportviewer

Upvotes: 0

Related Questions