Had a little play around with WPF, and SQL 2005 reporting services, as a quick proof of concept of a web based WPF hosted report viewer.
Why? We’re limited in a project to using SQL 2005 Reporting services + Visual Studio 2008. VS2008 SP1 has off the shelf (free/MS supplied) Windows report viewer or Web report viewer, but not yet a WPF report viewer for SQL 2005 Report Server.
So I did a quick challenge / spike for myself to see what was easier, felt better and would provide the best way to host SQL 2005 report server reports.
(method 1) create a WPF based report… host the report on a website, and then embed a standard MS web browser control inside WPF,
This is what I did:
(~ 1 minute) I installed the Adventure Works sample database for SQL 2005
(~ 2 minutes) to created a simple ASP.Net a report website (wizard project kicks you off) in Visual Studio 2008 SP1, (The left hand half of the screenshot shows this)
(~ 2-3 minutes) to create a WPF application and add a web browser control to it, then add a button, an event, and wire the event to display the report page. You do not need to add navigation to the web browser control. In fact the default is to not have any – you need to add extra bits like buttons etc if you want.
You might like the built in Excel and PDF export buttons (these are already included in the off-the-shelf reports.
Other nice things, there’s no explicit navigation to take you away unless you add it to the parent report, and the reports can be each self-contained.
(method 2) as above, just create your WPF application and add a windows report viewer control to it instead.
Personally I think the first method is easier; you get the added benefit that you can re-purpose the report website as a stand-alone site. You may want to simply add into a frame/iframe, etc., or create a parent page, to add some navigation … for the stand alone site.
Here’s the screenshot:
LSH is SQL 2005 + VS2008SP1 with the report project running (Cassini),
RHS is another instance of VS2008 SP1 running WPF viewing the same web page, but embedded in WPF