Report Design Basics
To create a basic report, you must specify which data you need for a report, how you want to organize it on the page, and how you want a user to view the report.
Parts of a Basic Report
A report has a header, a body, and a footer. A report also has a default page size with page headers and page footers. You can place report items such as images, text boxes, and lines in headers and footers. The body of the report contains the report data. You can place any type of report item in the body, including tables, matrices, lists, charts, and gauges. You link report data to report items on the design surface. When the report is processed, the report data and layout items are combined. When you view the report, the combined data and layout elements are sent to a report renderer. The renderer dynamically determines how much data fits on each page. Report parameters are used to specify the data to use in a report, connect related reports together, and vary report presentation.
With Reporting Services, you can place report items anywhere on a report; you are not limited to "bands" of data. You can place data regions with different sets of data side-by-side. Certain report items can also contain other report items. For more information, see Working with Data Regions and Adding Other Report Items.
Specifying Report Data
Reports use the following types of report data: a report dataset with a field collection (from a query that runs on a data source and returns data in rows and columns, where the column names provide the default field collection), built-in fields provided by Reporting Services, images that are used in the report, and report parameters. Report data is organized on the Report Data pane. Report data is linked to report layout elements through report expressions. Expressions can be written using built-in libraries or can access the full range of Visual Basic .NET Framework classes. For more information, see Connecting to Report Data and Working with Report Expressions.
When your dataset query includes variables, query parameters are automatically created for the dataset, and corresponding report parameters are automatically created for the report. When the user runs the report, they can type or select values that help customize the report data for their interests. For more information, see Using Parameters to Control Report Data.
Sample data for tutorials is available using the AdventureWorks OLTP database. For more information, see Reporting Services Samples.
Organizing Report Data on a Page
Reports use a variety of report items to organize data on a report page. Report items are available in the Toolbox. You drag report items to the report design surface and then drag report data from the Report Data pane to the report items on the design surface. The design surface is not WYSIWIG. The report items have an initial layout position that may change when the report is processed. The following list describes typical uses for different report items:
Textbox. Use for titles, date stamps, and report names. Placeholder text appears in text boxes where you have linked data and layout items. The placeholder text is display text for an underlying report expression. During report processing, report data is substituted for the report expressions and the calculated values replace the placeholder text.
Table, Matrix. Use to display tabular or crosstab data from a report dataset. Table and Matrix are templates of a Tablix data region and provide a starting grid layout for data from a report dataset.
Chart. Use to graphically display data from a report dataset. You can also nest a chart inside a Tablix data region.
Gauge. Use to present a visual image for a single value within a range of values.
List. Use to create a free-form layout like forms on a Web page. A List is a template of a Tablix data region and provides a starting layout for data from a report dataset.
Image. Use to add existing images to a report.
Subreport. Use as a placeholder another report. A subreport must be designed separately and published to the report server to be included in a parent report.
Line, Rectangle. Use lines and rectangles as graphical elements.A rectangle can also be used as a container for other report items. Use a rectangle to help control how report items like data regions appear on a report page when the report is rendered.
A typical report uses Tablix data regions. You drag fields from the Report Data pane and drop them on a Tablix cell for a data region, or to the Grouping pane to define groups for the selected data region.
Previewing or Exporting the Report
When you run a report using Preview, the report authoring client processes the report locally and displays the rendered report in HTML. Reporting Services extensions perform much of this work: a data processing extension is used to retrieve the data based on the type of data source and a rendering extension is used to provide report output based on the selected format. To see the report in other rendering formats, use the Export button on the toolbar. Different extensions can change the way data is processed and the report is rendered. For more information, see Understanding Rendering Behaviors.
When you publish (also known as deploy) a report to the report server, you must accept or change the default deployment properties. The report server processes and renders the report. Then you view the report using Report Manager by browsing to the report location on the report server, for example, http://localhost/reports/reportname.
Pagination in a report is determined by the page size of the report and any page breaks placed on report items. Rendering extensions that support page size, such as Image and PDF, format the data in the report to fit within each page. Rendering extensions that do not support page size render all data between page breaks on a single page. Some extensions that do not support page size may employ soft page breaks. The HTML rendering extension does this. The position of soft page breaks are determined by the size of the page, but are not as exact as page breaks placed by rendering extensions that support page size. All rendering extensions that support page breaks on items will start a new page after each page break in the report. For more information about working with page size and page breaks in Report Designer, see Understanding Pagination in Reporting Services.
Improving the Report Design
You typically work back and forth between the Design and Preview tabs to design the report and then run the report to see the rendered result in the report viewer. Typical changes you might make to a report to improve its presentation or performance are:
Add report parameters to allow a user to change the report data. Report parameters that are linked to query parameters on the dataset properties can reduce the amount of data retrieved from a data source. If you supply default parameters for each report parameter, the report runs automatically on first use. You can also provide a list of valid values for a parameter, so the user can choose from values that are known to exist on the data source. For more information, see Adding Parameters to Your Report.
Generalize a query by adding query parameters. The syntax for queries that include variables depends on the type of data source you connect to. For more information, see Using Query Parameters with Specific Data Sources (Reporting Services) and Using Variables and Parameters (Database Engine).
Organize report pages to provide answers to specific questions at a glance. For more information, see Understanding Pagination in Reporting Services.
Add interactive sort buttons to data region columns. For more information, see Sorting Data in a Report.
Add a date stamp and report name to the report. For more informtion, see Using Built-in Field References in Expressions (Reporting Services).
Use visibility options to hide complexity, but allow a user to drill down into areas of interest. For more information, see Hiding Report Items Conditionally.
Align chart groups with table groups to provide a way to visualize tabular data. For more information, see Linking Multiple Data Regions to the Same Dataset.
Provide conditional color or images to highlight data values. For more information, see Adding Conditional Formatting (Reporting Services).