Previous | Table of Contents | Next
Page 418
Figure 15.12.
Layout after reformat-
ting the objects.
Before you add a title to the report, be sure that there's enough space above the
column headings for the title, date, and page count. To add the title, follow these steps:
- Select the Text Tool from the toolbar and, while holding the left mouse
button, drag the area in which you want to enter the
titleFLUGLE COLLEGE Course Catalog. Between FLUGLE
COLLEGE and Course Catalog, press the Enter key so
that FLUGLE COLLEGE appears above Course Catalog.
- To center the text in the box, select Format | Alignment | Center from the menu.
- Format the title so that FLUGLE COLLEGE is MS Sans Serif, Bold, 14
points and Course College is MS Sans Serif, Bold, 12 points.
To add the current date to the report, follow these steps:
- Select the Field Tool from the toolbar and, while holding the left mouse
button, drag the area in which you want the date to appear.
- Double-click the field, causing a window to be displayed.
- Change the name of the field from
F_1 to F_CURRENT_DATE.
- In the drop-down list labeled Source, select
&Current Date.
- In the Format Mask, select Month DD, YYYY from the formats in the
drop-down list (see Figure 15.13).
- Also, set the font for the date to MS Sans Serif, Bold, 10 points.
- Click OK for these settings to be used for the field.
Page 419
Figure 15.13.
Specifying the date for
the report.
To add the page number to the report, follow these steps:
- Select the Field Tool from the toolbar and, while holding the left mouse
button, drag the area in which you want the page number to appear.
- Double-click the field, and a window labeled "Course: Layout Field - F_1" will
be displayed.
- Change the name of the field from
F_1 to F_PAGE.
- In the drop-down list labeled Source, select
&Physical Page Number.
- In the Format Mask, enter NNN.
- Also, set the font for the page number to MS Sans Serif, Bold, 10 points. At
this point, your report layout should look very similar to that shown in Figure 15.14.
- Click OK for these settings to be used for the field.
It's time to test the report.
- Click the green light on the horizontal toolbar. You should see a window
titled Runtime Parameter Form (see Figure 15.15).
- By default, the Destination Type for the report is set to Screen.
- Click Run Report. You will see a windowReport Progressthat displays
the activity that is occurring on both the client and the server. After a short time,
you should see the first page of the report as shown in Figure 15.16.
- Click Close when you are finished reviewing the report.
Page 420
Figure 15.14.
Current report layout.
Figure 15.15.
The Runtime
Parameter Formis
displayed.
Page 421
Figure 15.16.
First page of reportis
displayed.
There are several ways to print a report. By default, the Runtime Parameter Form sets
the report destination to the screen; in other words, the default behavior is that the user will
see a report preview. You can create your own parameter form in which the default
destination is the printer. However, even in preview mode, you can print a report by clicking the
Print button.
This is a good time to save your report. Like the Forms Designer, the Reports Designer
can use the Oracle database as a repository. To save a module to the database, you or your
DBA need to install the database schema needed by Developer/2000. To learn more about
this, read the Administrative Notes that are in the Developer/2000 Admin for Win95.
However, for the examples in this book, save the reports to a file. To set this as the
default in the Reports Designer, select Tools | Tools Options from the menu. In the Object
Access group, there is a field labeled Storage Type. By default, it's set to File/Database. Select
File from the drop-down list and click OK.
Page 422
To save this new report, follow these steps:
- Select File | Save As from the menu.
- Select the directory that you're using for storing your application-specific files.
- Enter Course for the File Name.
- Click OK. The Reports Designer will save a file named
Course.rdf in the designated directory.
NOTE
|
The Reports Designer enables you to have multiple reports
open simultaneously. You'll find this is a real convenience for
copying objects from one report to another.
|
Building a Master-Detail Report
Another common type of report is the master-detail. An example of this is a report that
lists each department and the instructors associated with the department. The Department
table is the master record while the Instructor table is the detail record.
To begin with, you need to create the data model for the report.
- Invoke the Data Model Editor by either clicking the icon to the left of the
Data Model node in the Object Navigator or by selecting Tools | Data Model
Editor from the menu.
- To create the master query, click the button labeled SQL on the toolbar on the
left-hand side of the window.
- Move the mouse to the main part of the window and hold down the left
mouse button, drag the mouse to the lower right, and release the mouse button.
Double-click query Q_1.
- Change the name of the query to
Q_DEPARTMENT.
- Click the button labeled Tables/Columns. Another window is displayed,
titled Table and Column Names, enabling you to choose the table and columns used
for the query.
- In the listbox labeled Database Objects, scroll down to the DEPARTMENT
table and select it.
- Select each of the columns in the Columns listbox
(see Figure 15.17).
Page 423
Figure 15.17.
Choosing the tables
and columns for the
master query.
- To use the selected table and columns in the query's
SELECT statement, click SELECT-FROM and CLOSE. You'll see the
SELECT statement that was constructed from the selected table and columns.
- Rearrange the column names so that they are in the order that you want to see
on the report: Department_ID and Department_Name.
- Also, add an ORDER BY clause to the
SELECT statement so that the rows will be ordered by Department_ID, as shown in Figure 15.18.
Figure 15.18.
Modifying the master
query's SELECT
statement.
- Click OK to return to the Data Model Editor. When you defined the
SELECT statement for the query, the Reports Designer created a group for the
master queryG_DEPARTMENT.
Previous | Table of Contents | Next
|
Используются технологии
uCoz