Previous | Table of Contents | Next

Page 411

Figure 15.2.
Creating query Q_1.

Figure 15.3.
Choosing the tables
and columns for the
query.

To use the selected table and columns in the query's SELECT statement, follow these steps:

  1. Click SELECT-FROM and CLOSE. You'll see the SELECT statement that was constructed from the selected table and columns.
  2. Rearrange the column names so that they are in the order you want to see on the report: Department_ID, Course_ID, Title, Description, Units, and Additional Fees.

Page 412

  1. Add an ORDER BY clause to the SELECT statement so that the rows are ordered by Department_ID and Course_ID, as shown in Figure 15.4.
  2. Click OK to return to the Data Model Editor.

Figure 15.4.
Modifying the query's
SELECT statement.

When you defined the SELECT statement for the query, the Reports Designer created a group for the query. As shown in Figure 15.5, the group's name is constructed from the query's name: G_COURSE.

Figure 15.5.
Group G_COURSE
created for query
Q_COURSE.

Page 413

Specifying a Default Layout

You've successfully created the data model for the report. The next step is to specify the report layout.

  1. To simplify this task, invoke the Default Layout dialog window either by clicking the green triangle on the horizontal toolbar or by selecting Tools | Default Layout from the menu.
  2. The Default Layout window contains two tab folders. In the Style tab folder, select the Tabular style (see Figure 15.6).

Figure 15.6.
Default layout dialog
window.

  1. Select the Data/Selection tab folder. This tab folder contains each group and the columns that are associated with it.
    By default, the Reports Designer constructs a label for each column by replacing each underscore in a column name with a blank. In addition, each word in the label has its initial character capitalized. As a result, the Department_ID column is given the label Department Id. You can change a label in the Data/Selection tab folder (see Figure 15.7).
  2. Click OK to generate the default layout for the report. You should now see the default layout generated for the report (see Figure 15.8). Admittedly, what all the boxes and lines represent isn't intuitive. You can get another view of all the elements by looking at the layout in the Object Navigator (see Figure 15.9).
  3. To navigate to the Object Navigator, select Window | Object Navigator from the menu. As you can see in the Object Navigator, a report layout may consist of a header, trailer, body, and margin. Only a body object was generated by the default layout. Beneath the body object is an object named M_COURSE_GRPFR—which is a

Page 414

frame for the entire group. Beneath M_COURSE_GRPFR are two other objects—M_COURSE_HDR and R_COURSE. M_COURSE_HDR is a frame that contains the header objects, whereas R_COURSE is a repeating frame that contains the actual fields of each record. R_COURSE is composed of three other objects:

F_ADDITIONAL_FEES A field containing the value of Additional_Fees
M_COURSE_EXP A frame that holds some other fields
M_COURSE_EXP1 Another frame that holds the re2maining fields that were specified for query Q_COURSE

Figure 15.7.
Changing a column
label in the Data/
Selection tab folder.

Figure 15.8.
Default layout
generated for the
report.

Page 415

Figure 15.9.
Default layout
hierarchy displayed by
Object Navigator.

  1. You wouldn't use this default layout without modifying it. For this report, you don't really need M_COURSE_EXP or M_COURSE_EXP1. So, using the Object Navigator, highlight each frame and press the Delete key.
  2. Object Navigator asks you to confirm that you really want to delete the frame. Click Yes. As shown in Figure 15.10, the fields contained within M_COURSE_EXP and M_COURSE_EXP1 should now be directly beneath R_COURSE.

The next task is to reformat the layout. Follow these steps:

  1. Return to the layout window by selecting Window | Untitled: Layout from the menu.
  2. First, delete the lines in the header frame; you can distinguish the column headings from the report body by using a bold font.
  3. Select each line and press the Delete key; be sure that you've selected a line and not a header.
  4. Now, resize each column heading by selecting it and holding down the left mouse button until it's the proper size.

Page 416

Figure 15.10.
Default layout
hierarchy displayedby
Object Navigator
after deleting M_COURSE_EXP and
M_COURSE_EXP1
frames.

The next task is to resize all three frames so that there is a half-inch margin on both the right and left sides. Also, you'll want to reposition the column headings.

  1. Resize the fields and place them beneath the column headings.
  2. A few of the column headings are too long. For example, you can shorten
    Department ID to Dept by selecting the heading, clicking the text button on the toolbar (the large T) and clicking the heading once more. You can then shorten
    the column heading.
  3. When you're done, the layout should look like that shown in Figure 15.11.

The layout appearance is still lacking. First, change all the column headings to a different font by following these steps:

  1. Select all the column headings by holding down Shift as you select each one with the mouse.
  2. Select Format | Font from the menu.
  3. Choose MS Sans Serif, Bold, and 12 pt, and then click OK.
  4. Repeat step 3 for each of the fields, but choose Normal instead of Bold.

Page 417

  1. Because the font has changed, you may need to resize some of the fields so that all the characters are visible.
  2. You'll also want to change the format mask for the field that displays Additional_Fees. By default, no dollar sign is displayed. Double-click the field labeled F_ADDITIONAL_FEES.
  3. In the Format Mask field, select $NNN,NN0 from the drop-down list and click OK.

Figure 15.11.
Layout after reposi-
tioning and resizing
the objects.

Sizing and Aligning Objects

You can make the column headings and fields the same height by increasing the height of one of them so that all of the characters are completely visible.

  1. Select the other objects that you want to have the same height, and select Arrange | Size Objects from the menu.
  2. Set the Width radio button to None and the Height radio button to Largest.
  3. Click OK. Your layout should look fairly similar to what is shown in Figure 15.12.

Previous | Table of Contents | Next

Используются технологии uCoz