Bayer White posted on November 08, 2005 14:46
Reporting Services includes the ReportViewer Server Control as one example that can be installed when you install Reporting Services. It can be reused for most if not all of your report viewing needs to build reports into your applications. In this article, I will discuss ways to implement the ReportViewer Server Control into a Reporting Services web application. I’ll also talk about URL access to reports and why I chose to use that type of access.
Here are some examples from MSDN online that show URL access commands…
- URL Access – A way to run and navigate reports in a Web browser.
- rc:Toolbar – Used to show or hide the toolbar. If the value of this parameter is false, all remaining options are ignored. If you omit this parameter, the toolbar is automatically displayed for rendering formats that support it. The default of this parameter is true.
- rc:Zoom – Used to set the report zoom value as an integer percentage or a string constant. Standard string values include Page Width and Whole Page. This parameter is ignored by versions of Microsoft Internet Explorer earlier than Internet Explorer 5.0 and all non-Microsoft browsers. The default value of this parameter is 100.
- rc:Parameters – Used to show or hide the parameters area of the toolbar. If you set this parameter to a value of true, the parameters area of the toolbar is displayed. The default value of this parameter is true.
- Example -- http://MyWebServer/reportserver/PVPortal/MissingTime?/PVPortal/MissingTime&rs:Command=Render&rc:Parameters=false
REPORTVIEWER ASSEMBLY
There are two flavors of Server Control to select from, either C# or VB.net. Check out the code and see how this class is using commands to render reports within Reporting Services. This control is only a wrapper to Reporting Services, making it easier for writing specific commands through QueryStrings to the ReportingServices Server instead of using the Report Manager to view reports.
The ReportViewer Server Control can be found in the following directory (if you’ve installed the samples on the C drive): C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\Samples\Applications
PASSING REPORT PARAMETERS AS QUERYSTRINGS
Because Reporting Services uses report commands thru URL access lets look at some advantages and disadvantages of using QueryStrings to pass these commands.
The advantages of using query strings are:
· No server resources required. The query string is contained in the HTTP request for a specific URL.
· Broad support. Almost all browsers and client devices support passing values in a query string.
· Simple implementation. ASP.NET provides full support for the query string method, including methods of reading query strings using the HttpRequest.Params property.
· Provides an alternative for passing information from Web Application to another
· Reporting Services utilizes QueryStrings
The disadvantages of using query strings are:
· Security. The information in the query string is directly visible to the user via the browser user interface. The query values are exposed to the Internet via the URL so in some cases security may be an issue.
· Limited capacity. Most browsers and client devices impose a 255-character limit on URL length.
Next I will go step by step on how to implement the ReportViewerServerControl within a Web Application an approach to actually sending the report selection criteria through query strings.