When you use a loop or table node, you usually specify an internal table. SAP Smart Forms reads the table line by line to retrieve the data. Since the number of entries in such a table can be too large to fit onto one page, use amain window for table output.
When you print a table, the size of a table is determined dynamically. The output control must consider several heights to calculate a page correctly:
When processing a table, SAP Smart Forms does not calculate the space required for the entire table in advance, but determines for each line whether it still fits onto the current page.
Withtable output, besides using the main area for output of table lines, you will frequently print a header and footer. If the footer is printed at the end of each page, the output control must consider the footer height when determining the position of the automatic page break. Therefore, you must specify a height for the footer output. If you don't, then the output control cannot reserve any space at the end of the main window and thus not print the inferior nodes of the footer before the page break.
Automatic Page Break vs No Break
The output control triggers an automatic page break to print contents on several pages. As a form developer, you may not want the system to automatically break a page, for example, if you want to print all lines of a table on one page. For these table lines, you must specifyNo Break with the line type to prevent the system from breaking up the table at the end of the main window for space reasons. If there is not enough space left on the current page, the entire table will be printed on the next page.
For all other output, you can use the output option
Requirements for Automatic Page Breaks
During output SAP Smart Forms must determine dynamically whether the output still fits onto the current page. Otherwise it must trigger a page break. When processing tables, this is of special importance, since the table lines are not printed immediately after the corresponding node is processed. Whenever a new line starts, the output control must determine the height of it. To do so, it stores the entire line in a buffer. The following examples illustrate why:
The cells within a table line contain data that may be printed on one as well as on several lines. If the line type is protected against page break, all cells of the table line must be printed on the page. This depends on the height of the highest cell within the table line.
Even if the table line type is not break-protected, a subsequent cell might contain a graphic which is higher than the first cells.
These examples illustrate that the output control can determine the height of each line only by analyzing the entire line in the buffer.
For form development not every detail of the output control is important. We want to concentrate on two questions: When is the footer processed? How is the automatic page break determined?
Program Lines Nodes
Nodes of type program lines must be considered separately:
The program lines nodes within a table or loop are processed in the desired sequence and only once per loop pass. But note that due to the mechanism described above they are executed out of sync with the output (with the new table node as well).
The procedure described there is required only if you want to sum up values with different currencies or measurement units. Otherwise you can use the Calculations tab of the new table node and avoid pondering about how to process the loop.