Поделиться через


Creating Client Report Definitions Using the Visual Studio Report Wizard

The Visual Studio Report Wizard is a tool within Visual Studio that you use to create the client report definitions (.rdlc) files associated with ReportViewer controls. The wizard guides you through the process of creating a report definition. In the wizard, you can specify report data, organize the data in row and column groups in a tablix data region, select a layout format, and choose a style.

You can open the Report Wizard to create an .rdlc file in a few different ways. For example:

  • For an existing project or Web site, in the Solution Explorer, right-click your project or Web site, select Add, then click New Item. In the Installed Templates pane, click Reporting. In the templates pane, click Report Wizard, and then click Add. The Report Wizard opens.

  • For a new project, select the Reports Application template. The Report Wizard opens automatically.

  • For a new Web site, select the ASP.NET Reports Web Site template. The Report Wizard opens automatically.

After you complete the wizard, you can modify and enhance the report in Visual Studio Report Designer.

Wizard Steps

The following sections describe the steps in Report Wizard.

Dataset Properties

First you must define a dataset to use based on a data source. Report Wizard provides a list of all data sources and associated datasets in the Visual Studio project, in addition to an option to create a new data source. When you click New, the Visual Studio Data Source Configuration Wizard guides you through creating a data source. For more information, see Creating Data Sources for a Report.

Arrange Fields

Next, arrange the fields into the row groups, column groups, and detail rows for the tablix data region. A tablix data region displays data in a flexible grid layout that uses static and dynamic rows based on the row and column groups that you specify. To display a strict tabular format, drag fields to the Values pane, click each field, and unselect the aggregate function that is added by default. For more information about tablix row and column group areas, see Understanding Tablix Data Region Areas (Reporting Services) in SQL Server Books Online.

Choose the Layout

Next, design the layout of the report. Here you can add grand totals and subtotals to your grouped data. You can decide whether the subtotals are shown above or below the group, as well as whether the groups can be expanded and collapsed.

Choose a Style

Finally, apply a style to the report using a style template.

When all steps are completed, Report Designer creates the report and adds it to the Visual Studio project.

Modifying the Client Report Definition

After you complete the wizard, you can open the report in Report Designer and continue to design the report. For example, you can add graphical elements such as images and lines, modify expressions for grouping, sorting, and conditional visibility, and include custom code.

For more information, see Designing and Implementing Reports Using Report Designer (Reporting Services) in SQL Server Books Online.

See Also

Concepts

Creating Client Report Definition (.rdlc) Files