CHAPTER 9 RENDERING REPORTS FROM .NET APPLICATIONS
Example URLs
Now that you’ve examined every component part of the URL, it’s useful to look at a few complete sample
URLs. You will need to have the report setup correctly from the readme.html file included from the
chapter download examples. The following URL renders the report in HTML 4 and hides the HTML
Viewer toolbar by setting the rc:Toolbar parameter value to false while also setting the Service Year
parameter to 2009:
http://localhost/reportserver?/Pro_SSRS/Chapter_9/EmployeeServiceCost&rs:Command=
Render&rs:Format=HTML4.0&rc:Toolbar=false&ServiceYear=2009
The next example passes a report parameter for ServiceYear of 2009 and hides the input display of
user-supplied parameters:
http://localhost/reportserver?/Pro_SSRS/Chapter_9/EmployeeServiceCost&rs:Command=
Render&rs:Format=HTML4.0&rc:Parameters=false&ServiceYear=2009
The next one uses the rs:Format parameter to set the default output format to PDF for the service
year 2009:
http://localhost/reportserver?/Pro_SSRS/Chapter_9/EmployeeServiceCost&rs:Command=
Render&rs:Format=PDF&serviceyear=2009
This example hides the report document map:
http://localhost/reportserver?/Pro_SSRS/Chapter_9/EmployeeServiceCost&rs:Command=
Render&rc:DocMap=false&ServiceYear=2009
This final example – in SharePoint integrated mode which you may not have set up – will hide the
toolbar:
http://localhost/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/Chapter
9/EmployeeServiceCost.rdl&rv:Toolbar=None
You’ve taken a brief look at the commands you need to render a report through a URL in both native
and SharePoint mode. In the remainder of this chapter, we’ll show how to create your own report viewer
as well as use the report viewer control. The custom viewer will use URL commands to integrate an SSRS
2012 report into a .NET Windows Forms–based application and the report viewer control will be used in
an ASP.NET web page.
Integrating SSRS 2012 with .NET Applications
Now that you have some understanding of how URL access works, you’ll learn how you can render
reports. You’ll start by looking at how to render a report by building a Windows Forms SSRS 2008 viewer
application that uses the .NET 2.0 WebBrowser control and URL access to render reports for your
application.
Building a custom Report Viewer Using the WebBrowser Control
We’ll show how to create a simple Windows Forms application that contains the embedded browser,
which you’ll use to view a report.