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
BBjAPI > BBjPrinter > 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() |
createPage(double conversion) |
|
double |
|
boolean |
|
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) |
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
|
Example - Purchase Requisition
See Also
BBj Object Creation and Assignment
Advantage Article: Dishing up Forms
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.