formatOut

Type: String[100]

Availability: Read or write at any time

The formatOut property of the TextBox class or Label class contains the system-defined formats of data in text boxes or labels that you specify during printing.

The system-defined data formats are listed in the following table.

Option Action
=date Prints the current date as specified in Control Panel.
=direct Sends the text of the control formatted in the font of the control directly to the printer. This provides you with the ability to send commands to the print driver; for example, the facsimile (fax) number when printing to a fax device. (See the JadePrintDirect class for details about the transient class that holds direct printing output directives.)
=formatdate

Prints the date in the format supplied in the formatOut text box of the Properties dialog Specific sheet in JADE Painter, as shown in the following example.

=formatdate dd/MM/yyy
=longdate Prints the current date in the long date format.
=page Prints the current page number.
=pagenofm Prints the current page number of the total number of pages in the document (for example, 2 of 8).
=shortdate Prints the current date in the short date format.
=time Prints the current time (in hh:mm:ss am / pm format).
=totalpages Prints the total number of pages in the document (for example, 8).

When the =pagenofm and =totalpages option are included in labels or text boxes on report frames, they are drawn to the size of the resulting text regardless of the original size of the label or text box. No clipping occurs if the text is larger than the width of the control. The alignment properties of the label or text box will still be used. To achieve this, the printed output is first written to a temporary file and the count of the total number of pages is inserted into the print output at the specified positions.

Print output is then processed as follows if a report uses the total page count feature.

  1. The output is written to a temporary file.

  2. For reports output directly to a printer (that is, the formatOut property is set to =direct), printing cannot commence until the entire report is completed.

  3. For reports being stored in the database (that is, reports that use the Printer class setReport method), output is retrieved from the temporary file and stored in the database only after the printer is closed.

    This is most evident when running in JADE thin client mode, as the printed output must be retrieved from the presentation client and passed to the application server at the end of the report rather than page by page, as the report is produced.

The code fragment in the following example shows the use of the formatOut property.

printForm.label7.formatOut := '=formatDate ' & dateFormats[formatIndex];
formatIndex.bump;
printForm.label8.caption := app.printer.String;
result := app.printer.print(printForm.detail);

See also the example of the formatOut property under "JadePrintDirect Class", in Chapter 1.