Page 877
Page 878
For many years , the predictors of the future have envisioned the concept of the paperless office wherein all correspondence and corporate records are stored online and all paper reporting is eliminated. Reality, however, has shown that hard-copy reports continue to be required at an ever-increasing rate.
Oracle Reports is the Developer/2000 tool provided to produce reports of data in the Oracle database. You can preview these reports on the user 's screen before printing them or print them directly. Optionally, you can also save report output in a file to be used at a later date.
This chapter explains how to set up the Oracle Reports environment and the methodology for constructing several reports. These reports cover all aspects of report development using Oracle Reports 2.5. Finally, this chapter summarizes a set of key tips to follow when creating a report.
Oracle Reports operates in a Graphical User Interface (GUI) environment, such as Microsoft Windows. You can perform functions by clicking iconic buttons or selecting menu items. The menus used by Reports dynamically change based on the current context of the tool and are fairly intuitive as to their specific purpose. The individual menu items are explained as needed throughout this chapter. The Oracle Reports Designer interface consists of three primary components or tools: the Object Navigator, the Data Model Editor, and the Layout Editor.
You use the Data Model Editor (shown in Figure 36.1) to define all the data elements to be included in the report. These data elements are queries, links, and miscellaneous columns that are organized into sets called groups. You operate the Data Model Editor using a set of iconic buttons that can be selected with the mouse.
On the left side of the window is a set of eight buttons used to create and modify the data elements. Table 36.1 describes these buttons (top to bottom, left to right).
Table 36.1. Data Model Editor buttons.
Button | Usage |
Select | Select data elements to be manipulated. |
Query | Define report SQL queries. |
Summary Column | Create column that is computed based on a column at a lower level. |
Placeholder Column | Create a column that is calculated in a PL/SQL procedure. |
Magnify | Zoom in/out in the editor. Click within the editor to zoom in on an object, or click while holding the Shift key to zoom out. |
Link Data | Create a logical link between separate database queries. |
Page 879
Button | Usage |
Formula Column | Create a column that is calculated as the result of a PL/SQL function. |
Cross Product | Define a matrix from two separate query groups. This button is used only for a special report called a matrix report. |
Figure 36.1.
The Data Model Editor
The buttons at the top of the editor window are used to perform functions that are also listed in the menu. You use the first button to open an already existing report and the next button to save the current report. The next two buttons run the report (the user defines the output destination) and print the report directly to the default printer. The next button clears the selected objects from the editor canvas. The sixth button presents a dialog that is used to create the default layout based on the structure of the data model. Finally, the last button invokes the context-sensitive help facility within Oracle Reports.
You use the Layout Editor (shown in Figure 36.2) to construct the format for the report. The editor presents each of the layout elements exactly as they will appear on the final report. Like the Data Model Editor, the Layout Editor is controlled through a set of iconic buttons as well as the menus. The buttons along the left side of the editor window are used to manipulate the layout objects. Table 36.2 describes these buttons (top to bottom, left to right).
Page 880
Figure 36.2.
The Layout Editor.
Table 36.2. Layout Editor buttons.
Button | Usage |
Select | Select the objects to be manipulated. |
Rotate | Rotate the object. |
Magnify | Zoom in/out in the editor. Click within the editor canvas to zoom in and click while holding the Shift key to zoom out. |
Rounded Rectangle | Draw a rectangle with rounded corners. |
Ellipse | Draw an ellipse or circle. |
Polygon | Draw a multisided graphical object. |
Freehand | Draw a freehand object while dragging the mouse. |
Frame | Create a layout frame. |
Page 881
Button | Usage |
Field | Create a report field. |
Oracle Graphics | Attach an Oracle Graphics object to the report. |
Anchor | Attach an object to another so that they maintain the relative position from each other in the final report. |
Additional Default Layout | Create an additional layout for the report. |
Frame Select | Select all objects within a frame. |
Reshape | Reshape objects. |
Line | Draw a line. |
Rectangle | Draw a rectangle. |
Arc | Draw a segment of a circle. |
Polyline | Draw a series of connected lines. |
Text | Insert constant text. |
Repeating Frame | Create a repeating frame. |
Link File | Attach an external file to the report. |
Button | Create a button on the report. |
OLE2 Object | Embed an OLE 2.0 object in the report. |
Below the editor buttons is a square (with the letter T in the center of it) that displays the attribute characteristics of any objects on the Layout Editor canvas. This display indicates the fill color, outside line color, and the text color of the object ”and can be changed with the palette selector buttons that appear directly below it.
At the top of the Layout Editor window is another series of iconic buttons for report control. The first four buttons (which are the same as the Data Model Editor) are Open File, Save File, Run Report, and Print Report. The next three buttons perform the standard Windows functions of cut, copy, and paste, whereby objects can be moved between the report and the clipboard. Next, the Default Layout button presents a dialog for the designer to choose the data model columns to be included in the report, and based on the user-defined options and the report type selected, the default report is created.
The next four buttons are used to select one of the four parts of the report that are to be edited. These parts (in order) are the body, margin, header, and footer. The body of the report is usually the main report and is the only essential part of the report that must be created. The margin is used to define items that should appear at the top or bottom of every report body page. The header is a page or set of pages that precede the report body, and the footer follows the report body. The header and footer are often used to present a summary of the information contained in the report body. Another use of these elements is to present the conditions that were used to define the report queries or to provide a banner page.