Anchors fasten an edge of one object to an edge of another object, ensuring that they maintain their relative positions. For example, you can anchor boilerplate text to the edge of a variable-sized repeating frame, guaranteeing the boilerplates distance and position in relation to the repeating frame, no matter how the frames size might change.
Anchors determine the vertical and horizontal positioning of a child object relative to its parent. The child object may be either outside of or contained within the parent.
Since the size of some layout objects may change when the report runs (and data is actually fetched), you need anchors to define where you want objects to appear relative to one another. An anchor defines the relative position of an object to the object to which it is anchored. Positioning is based on the size of the objects after the data has been fetched rather than on their size in the editor. It should also be noted that the position of the object in the Paper Layout view affects the final position in the report output. Any physical offset in the layout is incorporated into the percentage position specified in the Anchor properties.
There are two types of anchors:
Implicit anchors. At runtime, Reports Builder generates an implicit anchor for each layout object that does not already have an explicit anchor. It determines for each layout object which objects, if any, can overwrite it, then creates an anchor from the layout object to the closest object that can overwrite it. This prevents the object from being overwritten. The implicit anchor functionality saves you from having to define the positioning of each object. Implicit anchors are not visible in the Paper Layout view. However, you can specify in the Object Navigator Options dialog box that the Object Navigator display anchoring information. By default, objects are anchored to the upper left corner of their enclosing object. If this view of the Object Navigator does not show anchoring information for an object, you can assume that the object is anchored to its enclosing object, which might be the frame or the body.
Explicit anchors. You can create an anchor in the Layout editor using the Anchor tool, dragging from one edge of the child to the one of the parents edges. Any anchor you create for an object will override its implicit anchoring. Explicit anchors are always visible in the Paper Layout view unless you specify otherwise in the Layout Options dialog box.
When you anchor a child object to a parent object, the x and y coordinates of the anchors attachments are important.
If the parent object is located above or below the child object:
The vertical distance between the two objects is fixed. For example, in the figure below, the vertical spacing between the parent and Object 1 is fixed.
The horizontal positioning of the anchors x-coordinate on the child object is relative to the anchors x-coordinate on the parent object. For example, in the figure below, the anchor is 50% from the edge of the parent and 75% from the left edge of Object 1. Therefore, when this report is run, Oracle Reports will shift Object 1 25% to the left of the center of the parent.
If the parent object is located to the right or left of the child object:
The vertical positioning of the two objects is relative. For example, in the figure below, both ends of the anchor are about 80% down from the top edges of the objects. Therefore, when the report is run, Reports Builder will calculate the length of the two objects (as they may expand), calculate the y coordinate that is 80% down for both objects, and position the two objects so that those two points are separated by the amount of space separating them in the Paper Layout view.
The horizontal positioning between the two objects is fixed. For example, in the figure below, the horizontal spacing between the parent and Object 1 is fixed.
If you need to position an object outside a repeating frame or frame, but you want the object to be owned by the repeating frame or frame (that is, to be formatted when its owner is formatted), create an anchor that is attached to an object inside the frame or repeating frame.
You can create anchors to be collapsible. Collapsing anchors help avoid unnecessary empty space in your report. Such empty space can occur when the parent object does not print on the same page as the child object, either because the parent and child nondefault fit on the same page or because of an assigned Print Condition. A collapsing anchor allows the child object to move into the position that would have been taken by the parent had it printed. The child object will also maintain its relative position as defined by the anchor.
Copyright © 1984, 2005, Oracle. All rights reserved.