ProcScript for Printing and Reports

The ProcScript language provides print-specific statements and functions, but there are also instructions that should be avoided in reports.

The following ProcScript statements and functions are useful for printing:

ProcScript for Printing and Reports

ProcScript Instruction

Description

eject

Ejects a page when printing. Useful in the getFocus and Leave Printed Occurrence triggers

skip

Skips a specified number of lines when printing. Useful in the getFocus and leavePrinted triggers

compare

Compares fields of two adjacent occurrences. Useful for deciding when to print totals, subtotals, averages, optional text, and so on

print

Activate printing

$batch

Tests whether Uniface is running in batch mode, that is, that the application was started with the /bat switch.

$clock

Returns the current system time. Use to print the time in header or footer fields, or to log printing times in a log file. For example, to show the time a report was sent to printer: REPORTTIME.HEADER = $clock

$datim

Returns the current system date and time. Use to print the date in header or footer fields. For example: REPORTDATE.HEADER = $datim

$empty

Tests whether a specified entity, or entity within a named area frame, is empty. Useful in the getFocus trigger to decide whether or not to print occurrences

$lines

Returns the number of empty lines left on the page, excluding header and footer frames. Use $lines to test whether there is enough space left to print your break frame, or to start printing a new occurrence on the current page.

$next

Returns the field value of the next occurrence

$page

Returns the page number currently being printed. Use to assign the page number to fields in a header or footer frame.

$previous

Returns the field value of the previous occurrence

$printing

Test whether Uniface is printing the current form. This can be useful in the getFocus trigger, for example, if a form is used for both data entry and printing.

$totlines

Returns the total number of lines available on the page for printing, excluding any header or footer frames.

ProcScript to be Used with Caution When Printing

The following ProcScript functions can also be used for printing, but because they only return the number lines required to print without exapnsion, it is usually easier to set the Print— on Same Page property.

  • $framedepth—returns the number of lines needed to print a frame, as drawn on the component without allowing for expansion.

  • $occdepth—returns the number of lines needed to print an occurrence as drawn on the component, without expansion.

ProcScript That is Inapplicable for Reports

Users do not interact with report components, so do not use the ProcScript statements that require user interaction in reports. For example:

  • askmess

  • apexit

  • display

  • edit

  • help

  • run