20.3 Add a Formula Column

To have the department names appear in the center of this group report, it is simplest to have a column in the detail group for the department names. To achieve this result, you must create a formula column in the detail group that will display the department names.

To add a formula column:

  1. Click the Data Model tool in the toolbar to display the Data Model view.

  2. In the Data Model view, resize the G_ENAME group to be large enough to contain a third column.

  3. Click the Formula Column tool in the tool palette.

  4. Click in the G_ENAME group to create a formula column.

  5. Double-click the new formula column object (CF_1) to display the Property Inspector, and set the following properties:

    • Under General Information, set the Name property to DEPARTMENT.

    • Under Column, set the Datatype property to Character, and set the Width property to 14.

    • Under Placeholder/Formula, double-click the PL/SQL Formula property field to display the PL/SQL Editor.

  6. In the PL/SQL Editor, at the flashing cursor (after the word begin), type the following:

  7. Click Compile.

  8. Click Close.

  9. Click the title bar of the Report Editor to make it the active window again.