It is a little more complicated than what would work in FNSNAP. I will drop copies to the BRForum
Programs needed are:
formfill.br
formprn.br
Formfill allows you to name your form and set the data location for each field that you will be using as well as the justification, size, format and contents of the field. The contents of the field can the contents of an array cell, a static value or a formula. If a formula the formula can be an actual formula or perhaps a graphic.
Formprn is a program that holds the PCL of the form to be printed or some other stuff (fonts macros images) in a BR internal file about 30,000 chrs long records (the max that BR will allow). You import your form into FORMPRN using EXACTLY the same name as you did when you set the form up in Fornfill. That way the two data files can talk to each other.
When you want to print the form you pass 4 arrays to the function:
Mat A$
Mat A
Mat E$
Mat E
A$ and A are one dimensional arrays that generally hold static data for your form, like the employer info for a W-2
E$ and E are two dimensional arrays that hold the detail data, such as the employee name address etc. in the string array E$ and the wages, withholdings etc., numeric values for each employee in the E array
As you print your W-2's you tell the printing function how many employees on a page. The function prints that many employees then deletes them from the E$ and E arrays and starts a second page. This continues until E$ and E are NULL. At that point the function stops. The printfile number is returned as the value of the function to the calling program. This allows you to nest detail records and summary records in the same function call. For example you can say
Code: Select all
47236 LET FORMFIL=FNPRFORMFILL(PEDATE,ASK,"[FONT LINEPRINTER]","prsysc", RPAD$("94011-1",8),MAT A$,MAT A,MAT AS$,MAT AS,0,0,LOCATION$): !:
LET FNPRFORMFILL(PEDATE,ASK,"[FONT LINEPRINTER]","prsysc", RPAD$("94011-2",8),MAT A$,MAT A,MAT AS$,MAT AS,0,0,LOCATION$) !:
IF UDIM(MAT AS,1)>1 OR A(33)>0 THEN CLOSE #FNPRFORMFILL(PEDATE,ASK,"[FONT LINEPRINTER]","prsysc", RPAD$("94011-A",8),MAT A$,MAT A,MAT AS$,MAT AS,0,0,LOCATION$): !:
LET FORMFIL=0 !:
ELSE CLOSE #FORMFIL: : LET FORMFIL=0 !:
! 0=ASK 1=PDF 2=NWP 3=PCL
The above line of code prints the 940 form for 2011 as well as the 940-A form for the credit reduction by state.
If you are interested let me know and I will send you more information regarding this. Mike Storlazzi is using these functions and I'm sure he can tell you what his experience is with them in a high volume setting.
FNGeorge