views:

194

answers:

1

I've read rumors that with the Report Viewer component of Visual Studio 2010 Professional, it is possible to render HTML from the database into a report. Unfortunately, I wasn't able to find definite information online and I'd rather not buy the upgrade just to try it out.

Can anyone confirm or deny that this feature exists, preferably by citing a credible source (such as the VS 2010 documentation)?

(EDIT) Clarification: I'm talking about Visual Studio, not SQL Server. I know that SSRS 2008 and SSRS 2010 support rendering HTML. I also know that Visual Studio and SQL Server use the same libraries for rendering reports. That's why I think that it might be possible to render HTML in Visual Studio 2010 client-side ("local processing") RDLC reports. I just want someone to confirm this: Can I render HTML using the ReportViewer component of Visual Studio 2010?

+3  A: 

You can render subsets of HTML in a VS2010 Report Viewer by editing the Place Holder properties under "General" on the L/H side of the properties window. This will work in .RDLC or .RDL file.

According to your comment above:

@Alison: The problem is quite simple: If I display a field containing HTML in a report, this field shows the HTML source instead of the rendered content. Your statement that rdlc s in VS2008 Professional support HTML rendering surprises me. As far as I know, this is not the case (see, for example, stackoverflow.com/questions/2172105). Can you give more information on how you think it is possible to display rendered HTML in a VS2008 report (note that I am talking about rdlc reports, not Crystal reports)?

Create a placeholder, or select one that may already be in a grid for example. Right Click and select Placeholder Properties. General should be selected by default, look under Markup Type, select the "HTML - Interpret HTML tags as styles" radio button. This will cause the control to render a subset of HTML.

Clarification: This works for .RDLC files created with VS2010 and its Report Viewer.

http://msdn.microsoft.com/en-us/library/cc645967.aspx

D.S.
Thanks. Could you clarify how this relates to the client-side SSRS components (ReportViewer) available in Visual Studio? We are not using SQL Server Reporting Services...
Heinzi
Well, according to the link i posted: The text box report item lets you insert HTML-formatted text that you have retrieved from a field in your dataset into a report. The text can come from any simple or complex expression that evaluates to correctly formatted HTML. Formatted text can be rendered to all supported output formats, including PDF.
D.S.
@DScott: Thanks, but that's not really what I wanted to know. You are talking about *SSRS (= SQL Server Reporting Services)*. I am talking about *Visual Studio*.
Heinzi
The .RDLC files which do not run on a Server and are part of a VB/C# project should render/display HTML inside of the textbox control. If you are talking about rendering the entire report to HTML (like you can on the SSRS .RDL version) no I dont think you can do that. According to http://msdn.microsoft.com/en-us/library/ms345248.aspx unless it is an ASP.NET application.
D.S.
@DScott: I tried to do what you suggest in VS 2008, but Placeholders are not available there (there is no context menu option "Create placeholder"). So, can you confirm that the solution you suggested will work in VS 2010? (The link you provided links only to the SQL Server documentation.) I'm also willing to accept "*Yes, I tried it with VS 2010 client-side reports and it works*" as an answer...
Heinzi
PS: Yes, it's about rendering HTML inside a textbox control, not about rendering the report as HTML.
Heinzi
You are correct, the place holders are not available in VS2008. They are available in VS2010, which is what I tested the above with, and we use here. It was also using an .RDLC file. However, please remember it is ONLY a small subset of HTML which can be rendered, which is listed in the link http://msdn.microsoft.com/en-us/library/cc645967.aspx (scroll down to importing HTML into Text Box for the available HTML rendering).
D.S.
@DScott: Great, thanks!
Heinzi