Udostępnij za pośrednictwem


Using the ReportViewer Tasks Smart Tags Panel

The ReportViewer Tasks smart tags panel is provided on the ReportViewer Web server control and Windows Forms control so that you can do the following:

  • Choose an existing client or server report to use with the control.

  • Design a new report.

  • Choose data sources and update data source bindings. Choosing and updating data sources are necessary if you modify the datasets or reports after bindings have been created, or if you convert a server report definition (.rdl) file to a client report definition (.rdlc) file. For more information, see Updating and Rebinding Data Source References (Visual Studio Report Designer).

The ReportViewer Tasks smart tags panel is context-sensitive. Tasks change depending on the control type and whether you are using a server or client-side report. If you are using the Windows Forms control, a Dock in parent container task is also provided.

To access the ReportViewer Tasks smart tags panel, drag a ReportViewer control from the Data section of the toolbox onto a form or Web page, and then click the small triangle at the top right corner of the control. The illustrations provided further on in this topic show an example of the smart tags panel looks like.

ReportViewer Tasks Summary

The following table describes all of the tasks that you can choose.

Task Description

Choose Report

Select an existing .rdlc file from the project or choose Server Report to select a published report on a report server. You can only choose one file for each instance of the control.

When you select a report, code is automatically generated that instantiates the project data source and binds the data source to the control. Information about the data sources that are used by the report is embedded in the report definition. If you subsequently modify the data source or update the report to use a different data source, you must update the data binding code. You can use the tasks on the ReportViewer Tasks smart tag panel to generate the updated code.

Choose Data source

Select an existing data source in the project that provides a dataset to the report. You can use this task to update the control to use new datasets.

Rebind Data sources

Update the data bindings for the control if the dataset or report has been modified.

Report Server Url

For server reports, specify the URL to a report server.

Report Path

For server reports, specify the name and location of the report. The report path includes virtual folders in the report server namespace that are used to address reports stored on a report server. You cannot include URL access parameters in the folder path. Always begin the report path with a forward slash ( / ).

Design a new report

Open a new, blank report template in graphical design mode, and add a report (.rdlc) item to the project. You can only create client report definition (.rdlc) files. To create a server report, you must use Report Designer in SQL Server Reporting Services.

Dock in parent container

For the ReportViewer Windows Forms control, you can expand the control to use all of the available space in the form.

Undock in parent container

Click this task to reduce the size of the control.

ReportViewer Tasks for Server Reports

The ReportViewer Tasks smart tags panel includes an option for selecting a server report. A server report is a published report definition that runs on a Microsoft SQL Server 2005 Reporting Services report server. The Server Report option requires that you specify the server instance and the path to the report, as illustrated in the following diagram:

Smart tags for the Windows Forms control

ReportViewer Tasks for Client Report Definition (.rdlc) Files

You can also use the ReportViewer Tasks smart tags panel to select a client report definition (.rdlc) file.

Smart tags for the Web server control

See Also

Concepts

Converting RDL and RDLC Files
Adding and Configuring the ReportViewer Controls
Creating Client Report Definition (.rdlc) Files

Other Resources

Samples and Walkthroughs