Mar 14, 2006
Floating Boxes With Variable Data
Question:
How do I get an overlay to "float" with my variable data? For example, I want to draw a box around a total amount that occurs anywhere from line 2 to line 30.
Answer: First, create the box as an overlay to the height you want the box to be plus the thickness of the line itself, (a medium line is 4 PELS thick/ at 240 DPI a box 1/4" would be defined as 64 PELS), with the left boundary of the box at the horizontal position you want and the top boundary of the box defined at the top of the overlay. You can use OGL or the AFP Print Driver for windows to create the overlay.
Next, store the compiled overlay in your resource library.
Then, in your application, define an Include Page Overlay (IPO) command immediately preceding the record that contains your total amount. In the fields within the IPO command that are used for positioning, fill the X,Y coordinates with high values (x'FF'). The high values tell the print driver to use the current PRINTLINE position and place the Overlay relative to that position.
Check out the OGL reference materials available from IBM at: IBM Support Search OGL
Check out the PPFA reference materials available from IBM at: IBM Support Search PPFA
Check out the MO:DCA reference materials available from IBM at: IBM Support Search MO:DCA
If you would like additional information on AFP Tips and Techniques, please feel free to contact COPI at: 1-888-999-COPI.
Or, you can also view the archive of past AFP related articles by clicking here.