DIY: Alternative Reporting Services client

The other day I was looking for an alternative Reporting Services client, as an extra client besides the web-based Report Manager. As I couldn’t really find one I thought “how difficult could it be to write one myself?”.

And indeed, with the ReportViewer control in Visual Studio 2005 it’s really no big deal. All you need to do is drag the control onto a form, tell it that you want to load a remote report, configure the ReportServer so that it knows where to look for reports and the ReportPath so that it knows what report to load. Then call the RefreshReport() method to load the report.

When configuring the ReportPath, pay attention to the mandatory leading slash.

   1: reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
   2: reportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver");
   3: reportViewer1.ServerReport.ReportPath = "/My Reports/ReportName";
   4: // load report
   5: reportViewer1.RefreshReport();

The C# code snippet above is loading a report called ReportName, located on the local report server in a folder called My Reports.

Update: how to browse the reports on the server

Microsoft has provided an interesting sample called RSExplorer as part of the SQL Server samples, located at CodePlex.  Once you’ve installed the samples you can find RSExplorer in C:\Program Files\Microsoft SQL Server\90\Samples\Reporting Services\Application Samples\RSExplorer Sample\, if you chose to install to the default folder.

The sample shows how to use the Reporting Services web service to populate a WinForms ListView with a list of folders and reports, and even how to do some basic management tasks like creating a folder or editing a report description.

When you double-click a report it will open in a popup window.  What I do find funny in this sample is that the popup window, called ReportViewer, does not use the ReportViewer control.  It uses a WebBrowser control  instead.

Share

Tags: , , , ,

  1. Mark T’s avatar

    I think displaying the rpeorts is pretty easy, what I have been looking for is some form of alternative to the report selection part of Report Manager. I don’t want to create a hard coded page of links, I want it to detect the reports in the folders, but lay them out in a better, more customisable way.

    Have you ever come across anything suitable in your research.

    Thanks

    Reply

  2. Valentino Vranken’s avatar

    Thanks for the interesting question Mark. I was actually wondering about it myself when I wrote the article but didn’t have the time to investigate at that moment. Now I do have the time and found an answer :-)

    I’ll add an update to the article above. In short: it can be done by using the SSRS web service.

    Reply

  3. Nathan Patrick’s avatar

    Full disclosure, I work at Windward.

    As an alternative to SSRS, Windward’s Autotag detects the reports and data just like you mentioned. It can pull from any source SSRS can, plus a few more. We put together a comparison of SSRS and AutoTag if you’re interested!
    http://www.windward.net/reporting-comparisons/ssrs-comparison/

    Reply

© 2008-2017 BI: Beer Intelligence? All Rights Reserved