Databases Reference
In-Depth Information
ReportViewer Control
The ReportViewer control is used to display rendered reports. You can interact with reports as you would
in Report Manager, using links within the report and DHTML functionality for collapsing report sections.
For drill-down reports, the target report displays in the same Report Viewer Web Part. Drill-through
reports, however, are rendered in a new browser window. Depending on the layout of the report and the
size of the Web Part on the page, only a portion of the report may be visible. You'll need to use the scroll
bars to view the rest of the report. As with standard Web Parts, you can change the size of the Report
Viewer on the page in the Tool Pane. The Tool Pane is a configuration window that lets you set property
values for Web Parts displayed on the SharePoint page.
Like the Report Explorer Web Part, the Viewer can be used in connected or stand-alone mode. In connected
mode, clicking a link in the Report Explorer renders the report in the Viewer. With the Report Viewer in
stand-alone mode, it doesn't have the Explorer pointing it to a report for rendering. You'll have to provide
the path to the report manually. The report path is set using the Tool Pane. Though this might not seem
very user-friendly, it has a purpose. Once the report path has been set, the Viewer can then display the
report without user-initiated input or action.
Report parameters are displayed at the top of the Viewer content area. This parameters section expands
to display the report parameters, with the standard Report Manager toolbar below it. Using the toolbar,
reports can be exported in either Excel or PDF format.
Summary
In this chapter, we saw three ways to render reports from Reporting Services. The first part of the chapter
focused on rendering reports via URL requests. The second part looked at rendering reports programmat-
ically through the Reporting Services Web service. In the last part, you used the ReportViewer control to
easily embed reports in a Windows application.
URL rendering gives you a quick way to add Reporting Services reports to your own applications. You
can add Reporting Services reports to custom portals or create your own custom report links in other
applications.
Rendering reports directly through an ASP.NET application can be very helpful. It allows developers to
create their own interface for items such as parameters. A key point to remember is that Report Manager
uses the same Reporting Services Web Service that we used in the examples in this chapter. So, anything
that you can do from the Report Manager can also be done through your own code. This adds an incred-
ible amount of flexibility for developers of custom applications.
This chapter has shown you how to:
Use simple URL query strings to access reports.
Programmatically work with the Reporting Services Web Service API.
Embed reports into custom Windows and Web applications.
Work with the ReportViewer control in Visual Studio 2005.
Search WWH ::




Custom Search