The following excerpt, courtesy of McGraw-Hill Osborne Media, is from Chapter 5 of the book Microsoft SQL Server 2005 Reporting Services 2005 written by Brian Larson. Click here to purchase the book.
Populating a table item
Transport List Report, Task 3: Place a Table Item on the Report and Populate It
- Click the Layout tab to begin working on the report layout.
- Click the Table report item in the Toolbox. The mouse pointer changes to a table icon and crosshairs when you move your mouse pointer over the report layout area, as shown in the next illustration.
- Click-and-drag the mouse over the lower three-quarters of the report layout area, as shown in the following illustration. Note, when you begin dragging, the mouse pointer changes back to the usual arrow icon.
- When you release the mouse button, after dragging, a table is created to occupy the area you just defined. By default, every cell in the table is occupied by an empty text box. Click in each cell of the table, and note the name and type of report item shown at the top of the Properties window.
- Let's take a few moments to go over the methods for selecting various parts of the table. You have already seen how to select individual cells. The gray border on top of and to the left of the table item provides handles for selecting other parts of the table. Click any of the gray rectangles in the border above the table item. This action selects the corresponding column, as shown in the following illustration.
- Click any of the gray rectangles in the border to the left of the table item. This action selects a row, as shown here.
- Click the gray square in the upper-left corner of the border. This action selects the entire table. When the entire table is selected, the gray border is replaced by the sizing handles (the small white squares) for the table. You must select the entire table before you can move and size the table item.
- In the Datasets window, expand the TransportList dataset. Drag the SerialNumber field from the Datasets window and drop it on the middle-left table cell. An expression that returns the value of the SerialNumber field is placed in the text box that occupies the middle-left table cell. The name of the field is used to create a column heading. This is placed in the upper-left table cell.
- Drag the PurchaseDate field from the Datasets window and drop it on the center table cell. Drag the LatestRepairDate field from the Datasets window and drop it on the middle-right table cell. The report layout should now appear, as shown next.
- Select the header row (the top row) by clicking the gray rectangle in the border to the left of the row.
- Make the following changes in the Properties window:
- In the gray border to the left of the table, click the line between the header row and the detail row. Drag it to reduce the height of the header row.
- In the gray border to the left of the table, click the line between the detail row and the footer row. Drag it to reduce the height of the detail row.
- Click the center cell in the table. Hold down SHIFT and click the middle-right cell in the table. Both of these cells are now selected. Make the following changes in the Properties window:
- Click the Preview tab to preview the report. The report should appear as shown here.
Your installation of the Report Designer may be using a feature called Auto-Hide with the Toolbox. Auto-Hide is used to provide more screen space for your report layout. When Auto-Hide is active for the Toolbox, the Toolbox is only represented on the screen by a tab containing a tool icon and the word "Toolbox" at the extreme left side of the window. To view the actual Toolbox, place your mouse pointer on top of this tab. After a second or two, the Toolbox appears. Once your mouse pointer moves off the Toolbox, it is automatically hidden again.
|FontWeight (expand the Font property to find the FontWeight property)||Bold|
Task Notes In the Properties window are several instances where a group of related properties are combined under a summary property. For instance, the FontStyle, FontFamily, FontSize, and FontWeight properties are combined under the Font property. The Font property serves as a summary of the other four. Initially, only the summary property is visible in the Properties window. A plus (+) sign to the left of a property tells you it is a summary property and has several detail properties beneath it. The summary property has a value that concatenates the values of all the detail properties underneath it. For example, suppose the FontStyle, FontFamily, FontSize, and FontWeight properties have the following values:
In that case, the Font property has this value:
|Font:||Normal, Arial, 10pt, Bold|
You can change the value of a detail property by editing the concatenated values in the summary property, or you can expand the summary property and edit the detail properties directly.
Click for the next excerpt in this series: Transport List Report Task 4: Add Table Grouping
This was first published in February 2006