Using PowerFORM: Bitmaps, Hopper Selection and Duplex Printing
PowerFORM is NetCOBOL's answer for your print reports - you use a GUI report design tool, then write the reports using normal COBOL syntax except that instead of writing the report line by line you write a whole chunk (called a partition) at one time. Here are a few tips that you might find helpful when using PowerFORM.
-
Finding Information on PowerFORM
The PowerFORM RTS help file contains a lot of detailed information for doing more sophisticated things with PowerFORM. However, you can only access it by finding the help file using Windows Explorer or a similar tool. The file is called "pformapi.hlp" and is installed in the PowerFORM folder (located at "c:\fsc\PowerFORM" if you took the installation defaults). For example, pformapi.hlp contains a list of PowerFORM error codes (the second part of a 90xx code) in the "Trouble Analysis and Recovery" appendix. It also defines all the Printer Information File parameters in the "Environment Setting Files" chapter.
-
Using Bitmap Fields
With PowerFORM you can place bitmap fields in partitions. At run time you move the name of a bitmap file to the bitmap field and PowerFORM prints the bitmap in the specified area of your report. The bitmap can be stretched or clipped according to your preference. To have the bitmap field print you need to include the following statement in your program (one statement for each bitmap field):
MOVE "B" TO EDIT-MODE OF bitmap-field-name
This lets the COBOL system know that the field is a bitmap field. EDIT-MODE is a special register used with PowerFORM fields. If you do not include this line you will receive an I/O error on your print file with an error code of 9042. (The help file tells you that "The specified media data could not be loaded" - the help file uses the phrase "media data" to describe bitmap files.)
-
Controlling Printer Details such as Hopper Selection and Duplex Printing
PowerFORM printer details are setup in two places:
- The Form Descriptor Properties dialog, accessed by selecting "File, Form Properties" from the menu bar, and
- The Printer Information File - a text file that you point to by mapping the ASSIGN TO name to the text file name in your Runtime Environment Information. (See the "PowerFORM Getting Started Guide", Chapter 4, "Programming with PowerFORM" for details).
To achieve correct hopper selection, or duplex printing, you need to ensure that information in both places is set correctly. The settings are as follows:
HOPPER SELECTION
Depending on your printer, hoppers can be described as hoppers, bins, trays or some other term. Different printer drivers may also use different text strings to identify the different hoppers. The first thing you need to do is find out the strings used by your printer driver. These are likely the strings displayed in your printer's Properties dialog in the "Paper Source" or "Paper Tray" field (or similar term).Suppose your hoppers are described as "Tray 1", "Tray 2" and "Tray 3", and you want to print from "Tray 2". You then setup the following information:
In the Form Descriptor Properties Dialog
- Set "Paper Source" to "Default".
- Set "Printing Method" to "Descriptor".
In the Printer Information File
Include the following lines:
SUPLY H2
MAPINFO SUPLY,H2="Tray 2"The SUPLY line says you want to print from hopper 2, and the MAPINFO line tells the PowerFORM runtime that the name to use for hopper 2 is "Tray 2".
DUPLEX PRINTING
For duplex printing you need to decide if you want your document to be bound from the top or from the side as this affects whether the print goes in the same or opposite directions on the two sides of the form.You then setup the following information:
In the Form Descriptor Properties Dialog
- Set "Print Side" to "Both Sides".
- Set "Printing Method" to "Descriptor".
In the Printer Information File
Include the following lines:
SIDE Y
BSUP LThe SIDE Y line specifies duplex printing, the BSUP L line specifies binding on the left side. "BSUP U" would specify binding on the upper side.
Note: In both hopper selection and duplex printing you have to set "Printing Method" to "Descriptor", yet the settings in the Printer Information File still have an effect. This is because the Printer Information File is always used. The "Printing Method" selection determines whether certain information in the descriptor file is also used.


