Pages, Windows and Main Window Flow
Understand SmartForm page layout, windows and why main window is critical for item tables.
Explanation
SmartForms use pages and windows to control layout. A page can have multiple windows such as header, address, footer and main. The main window is special because it can flow across pages. Long item tables should normally be placed in the main window so they continue to the next page. Fixed windows do not flow in the same way. Many layout problems happen when item tables are placed in a normal window and then overflow, disappear or overlap. Understanding main window behavior is essential for invoice, PO and delivery outputs.
Code example
* SmartForm layout concept:* HEADER window - fixed header/logo/company details* ADDRESS window - vendor/customer address* MAIN window - item table that can flow to next page* FOOTER window - totals, terms, page number * Design rule:* Put long repeating item tables in MAIN window.* Use fixed windows only for content with predictable height. * Example business logic in driver:* Driver sends all items to IT_ITEMS.* SmartForm table node inside MAIN window loops over IT_ITEMS.Real project scenario
A purchase order item table was placed in a secondary window and items after line 20 were missing. Moving the item table to the main window allowed page continuation.
Common mistakes
- Putting long item tables in fixed windows. - Not testing multi-page output. - Overlapping footer with item table. - Ignoring page continuation logic.
Best practices
- Use main window for long tables. - Keep header/footer windows predictable. - Test single-page and multi-page cases. - Avoid overcrowded page design.
Interview angle
Interviewers may ask why table lines are missing after first page. Main window placement is often the answer.