Symptoms
The borders of a repeating group's instances cannot be defined within this group's logic.
Cause
In some cases, it is impossible to set clear borders for a repeating group since its instances span different pages or there is no clear keyword to be used as the bottom border.
Resolution
A second repeating group can be created as a frame to mark the start and the end of the first repeating group. For demonstration purposes, the desired group will be called RepeatingGroupA, while the second group that serves to find RepeatingGroupA's borders will be called RepeatingGroupB.
RepeatingGroupB should be placed above RepeatingGroupA in the tree of elements and should be captured first. Then, the following pre-search relations should be added to RepeatingGroupA properties:
int currentInstance;
if HasInstances then
{
currentInstance = InstancesCount + 1;
}
else currentinstance = 1;
if RepeatingGroupB.InstancesCount >= (currentInstance + 1) then
{
Below: RepeatingGroupB.Instance(currentInstance ).Rect;
Above: RepeatingGroupB.Instance(currentInstance+1).Rect;
}
The currentInstance variable and the first IF clause determine the number of the current instance of RepeatingGroupA.
A particular instance of a repeating group can be referred to as SearchElements.RepeatingGroup.Instance(i), so the second IF clause looks at the number of the instance of RepeatingGroupB and places the current instance of RepeatingGroupA between them.
Methods Above and Below serve the same function as manually set relations Above... or Below... in an element's properties.
Comments
0 comments
Please sign in to leave a comment.