Print_Wrap
See Also: BasicReport class, Output_Wrap, Print
Purpose
To move to an image window, text data that may be longer than the window, for output through repeated outputs of the image containing the window. This command is only used with legacy style reports that use screen images for output formatting, such as the BasicReport class; most DataFlex reports do not use this technique (or this command).
Syntax
Print_Wrap {field} | {source} [To {window}]
Argument Explanation
- Window: Must be a window in a DataFlex image. It may be omitted where an autopage command is in effect.
- Source: Must be a single constant or string variable.
What It Does
Print_Wrap moves the contents of a sequential file or Text-type database field to a window for outputting through successive repetitions of the image. When an image containing one or more fields addressed in Print_Wrap commands is output using the Output_Wrap command, the field(s) is filled with as much material as it can hold, and the image is output. This process is repeated until all fields addressed with Print_Wrap have reached the end of the sequential file or Text field to which they are assigned.
When a report is running and output repetitions trigger a page break, page headers and subheaders, if used, are output in the normal manner. The output of subtotals, if used, is likewise unaffected by the use of wrapping fields.
Multiple Print_Wrap fields can be used to output the contents of different sequential files and fields in columns.
Where multi-line output is desired from the image for each record, use of a separate image containing no Print_Wrap windows is required. Such an image may precede the image containing Print_Wrap windows, follow it, or both. Where the report class is used, subheader and subtotal facilities may be adapted to such purposes.
Notes
-
If Output (instead of Output_Wrap) is used to output an image containing a field addressed with Print_Wrap, the field(s) addressed with Print_Wrap will be blank in the output.
-
If the image containing one or more fields addressed with Print_Wrap is more than one line high, the output of any one such field will be separated from the previous output by the number of lines the image is high, less one, which is normally an undesirable effect. Therefore, images containing wrapped fields should be only one line in height.
-
Fields addressed by the Print command may be freely intermingled with fields addressed by the Print_Wrap command.
-
Print_Wrap breaks lines on spaces, tabs, and end of line characters. Where no such character can be found in the portion of the input field or file to be output, the break in output occurs wherever the end of the field falls.
-
Windows addressed by Print_Wrap may not be of type Date or Number. Format options other than capslock are unlikely to yield desirable results on such windows.
-
It is not necessary to use Direct_Input to open sequential text files for Print_Wrap. This is accomplished by Print_Wrap itself, which should be considered functionally equivalent to Direct_Input.