BBjForm

Description

In BBj 4.0 and higher, the BBjForm object allows users to build and print a document on the associated printer.

The BBjForm API provides an object-oriented interface for building forms and reports for printing. It provides a good substitute for using SYSPRINT and PWINDOW for form building. SYSPRINT allows programmers to lay out a form, but requires everything to be explicit. It does not provide any abstraction. PWINDOW provides good abstraction, but the controls are focused more on the needs of a GUI rather than a printed form. The BBjForm API overcomes the shortcomings and limitations of both of these approaches by making available an object-oriented API specifically designed for laying out printed forms and reports.

There is a clear path for using the BBjForm API. First, get the correct printer from BBjAPI and set the appropriate printer options on the resulting BBjPrinter object. Next, obtain a BBjForm object that represents a single printed form, allowing creation of one or more pages of the form. The programmer can lay out each page independently by creating BBjForm objects, setting their attributes, and adding them to the page. When the form is completed, use BBjForm methods to print, preview, or cancel the form.

Creation

BBjAPIBBjPrinter > BBjForm

The BBjForm object is created through the following BBjPrinter object method:

Return Value

Method

BBjForm

getForm(int dialog)

Methods of BBjForm

Return Value

Method

void

cancel()

BBjFormPage

createPage()

BBjFormPage

createPage(double conversion)

double

getDefaultUnits()

boolean

isJobComplete()

void

preview()

void

preview(BBjPrintPreview previewControl)

void

preview(boolean maximize, string style, BBjNumber zoom)

void

preview(boolean maximize, string style, BBjNumber zoom, boolean secure)

void

preview(boolean maximize, string style, BBjNumber zoom, string editPassword)

void

preview(boolean maximize, string style, BBjNumber zoom, string editPassword, string openPassword)

BBjPrintPreviewBuilder

previewBuilder()

void

print()

void

setDefaultUnits(double conversion)

Constants

POINT_UNITS

Measurement in native Java printing units, about 1/72 inch. This is the default setting.

INCH_UNITS

Measurement in inches.

MM_UNITS

Measurement in millimeters.

Example

rem 'Get a BBjPrintDoc for this printer

rem 'Obtain the instance to the BBjAPI object
myAPI! = BBjAPI()

rem 'Obtain an instance of a default BBjPrinter object
let myBBjPrinter! = myAPI!.getBBjPrinter(0)

rem 'Get BBjForm for the selected printer
let myForm! = myBBjPrinter!.getForm(1)
release

Example - Purchase Requisition

See Also

BBjAPI

BBj Object Variables

BBj Object Creation and Assignment

BBj Object Error Handling

BBj Object Operators

Advantage Article: Dishing up Forms

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.