KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Loading page settings programmatically when printing multiple forms
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Mac & Win
Published On: August 24, 2001

If you wish to load the print settings when printing multiple forms, you will need to do this programmatically. If you do not do this programmatically, you will notice that the first form will print correctly with the print settings, and all other forms will not print with the same settings. The following code example will make sure that page settings are loaded when printing multiple forms.

ALL RECORDS([Table 1])
For ($vRecord;1;Records in selection([Table 1]))
 If (Mod($vRecord;2)=0)
  PAGE SETUP([Table 1];"Form1")
  PRINT FORM([Table 1];"Form1")
 Else
  PAGE SETUP([Table 1];"Form2")
  PRINT FORM([Table 1];"Form2")
 End if
 PAGE BREAK
End for

You should make sure that the PAGE SETUP command is executed before each PRINT FORM command.