Archive for March, 2011

Central Pro loops during processing

Sometimes you will find that after some edits in your form, or on inclusion of certain data, Central will enter an infinite loop whilst processing pages.

This could have a number of obscure causes, but the most common is this: a combination of incorrect placement of $POSITION field; inappropriate subform size; and Page Full settings configured to conditionally start new pages.

The $POSITION field

When a subform is drawn on the page, the metaphporical drawing head returns to the leftmost part of the printing area, and slightly lower, ready to draw the next subform.

If the subform contains a $POSITION field however, the writing head will start drawing where the position field as, as if that position field were its {0,0} coordinates.

If a $POSITION field is in a JFMAIN page (which serves as the template page for other pages) then it will determine where the start of drawing is located.

The Page Full settings

As subforms are placed on the page, the page fills up, eventually reaching the bottom. Page Full settings can be used to determine when to skip to another page, for example, when there is no more room for a new subform instance, as well as some extra subforms (for example, footers, defined on “At End-Of-Page”).

When the page is full, a new page starts, and the subform that was going to be placed on the previous page is instead placed on the new page. It is important to note that when this is done, the page-full conditions are run again.

The subform size

If a subform is too big for the printing area, it will be truncated at the bottom (print off the bottom of the page) before a new page is started, unless the option “Reserve space for the current subform plus these subforms” option is ticked in the subform’s properties, under Page Full.

If the Reserve Space option is ticked, a new page will be started, and the subform will again be laid down on the page.

Now imagine these scenarios:

a) There is no room on the page for the subform, so a new page is started. The $POSITION field is low enough on the page so that there is still no room for the subform. So a new page is started, where the $POSITION field is again too low.
–> Infinite loop

This often happens when a $POSITION field in a JFMAIN has been moved too low for some reason. Bring the $POSITION field back to the top left corner of the printable area.

b) A large subform whose veritcal size exceeds that of the page is called. A new page is started for the subform, but the page is still too small. So a new page is started, but the page is still too small.
–> Infinite loop

This often happens when either the $POSITION field is set too low, or when the form design was made for the PDF default presentment target (it makes use of the whole page space), but the processing is done for a physical target (for example, a printer), where physical margins reduce the printable area. To correct this, set the default presentment target to be the one with the most restrictive margins (which will show in the design area as dark gray), and only allow items to be as tall as that space (remember to also account for header and footer spaces), and adjust the $POSITION field accordingly.