Reports Builder creates implicit anchors at runtime in the body region. The margin algorithm differs slightly.
Determine which objects are not entirely enclosed by a repeating frame of frame (directly or indirectly), or explicitly anchored to an object that is enclosed by a frame or repeating frame (directly or indirectly). We'll call these objects Type A objects. (Type A objects are typically group frames, repeating frames, other objects you create that are not owned by a frame or repeating frame, and so on). An object is considered to be enclosed by another object only if all of the following are true:
Both objects belong to the same region (Body or Margin).
The outermost of the two objects is a frame or repeating frame.
The outermost of the two objects is behind the other object.
The innermost of the two objects lies entirely within the borders of the other object.
Determine all children objects of a frame or repeating frame (these are the non-Type A objects). We'll call these objects Type B objects.
Follow this procedure for Type A and Type B objects independently:
Find all objects that are of the same type (for example, Type A), and are on the same layer.
Determine which of those objects have potential to "push" other objects of that type. An object has potential to "push" object of that type if it has a Horizontal or Vertical Elasticity setting of Variable or Expand, and a second object is located in its "push path" (that is, in the area in which it can possibly grow). Also, a repeating frame with a Horizontal or Vertical Elasticity setting of Fixed or Contract has a "push path": its Print Direction.
Create pairs of objects. Each pair must contain a pusher (that is, the object that will grow) and a pushee (that is, the object that will be pushed). When creating these pairs, a pushee object cannot be a child of an explicit anchor--those objects are ignored.
Go through this loop. For each pair, determine the distance in the "push path" between the pusher and pushee. Next, find the pair with the shortest distance. Finally, create an implicit anchor between those two objects using this algorithm:
If the "push path" direction is Down, anchor the pushee object's top 0% to the pusher object's bottom 0%.
If the "push path" direction is Across, anchor the pushee object's left 0% to the pushed object's right 0%.
That pair is now treated like one object, and the loop continues until either all objects have one anchor, or nothing will push the remaining, unanchored objects.
For each remaining, unanchored object, create an implicit anchor from the top-left corner of the object to the top-left corner of the body region.
Move to the next layer, and follow the procedure starting at step 1.
If an object is in the "push path" of two other objects and it is equidistant from the other two objects, the implicit anchoring of the object may vary between executions of the report. For example, the drawing below shows two cases where this could occur:
In the first case, M_Sums is in the "push path" of both B_Text1 and R_Ename. Because M_Sums is equidistant from B_Text1 and R_Ename, though, the normal criteria (shortest distance) for determining implicit anchors does not work in this case. Consequently, the formatting algorithm will randomly create an implicit anchor between M_Sums and either B_Text1 or R_Ename at runtime. To avoid this behavior, you could create an explicit anchor between M_Sums and B_Text1 or R_Ename.
In the second case, B_Text3 is in the "push path" of M_Emp. Since the bottom edges of M_Emp and R_Mgr are virtually in the same position, though, B_Text3 could be implicitly anchored to either M_Emp or R_Mgr. Consequently, the formatting algorithm will randomly create an implicit anchor between B_Text3 and either M_Emp or R_Mgr at runtime. To avoid this behavior, you could create an explicit anchor from B_Text3 to one of the objects or remove the explicit anchor between R_Ename and B_Text2. Removing the explicit anchor would cause R_Mgr to be treated as a descendant of M_Emp and, therefore, the implicit anchor would always be created between B_Text3 and M_Emp.
(Note that Case 2 is most likely to occur in character mode, where it is common to have the edges of objects overlap in the Paper Layout view.)
Reports Builder creates implicit anchors for all Type B objects in the margin region using the Body algorithm . For each Type A object, however, Reports Builder creates an implicit anchor from the top-left corner of the object to the top-left corner of the margin. No Type A object will be implicitly anchored to another Type A object. (This ensures that Type A objects will not be pushed off the page. However, they may be overwritten by another Type A object, if they are found on the same layer.)
Copyright © 1984, 2005, Oracle. All rights reserved.