X of Y

Keith' Weatherhead keithw at ddltd.com
Thu Oct 13 14:02:47 PDT 2005


Gary Olman wrote:
>  Thank you all, but here is the precise problem. I am printing invoices in a
> batch process. Some of the invoices are 1 page long so page 1 of 1 is called
> for, some are more than 1 some are 2 pages long some are 3 and so on. The
> page number should total on the last page of each invoice. The invoices are
> sorted by invoice number, with a break on invoice number change.
> Gary

Gary,

I've done this since 1987 fP 3.0 or whatever it was back then.  I'll 
even add to the stakes that I generate 12 subtotals plus the grand 
total that is ALWAYS on the bottom of the last page, regardless of 
how many pages there are.

One invoice form all dummy variables the length of the data area.

The first pass thru the transactions I do all the totlaing and get a 
count of the line items to print.

Line Items+qty of totals lines/lines per page (+1 if not even) get 
of pages.

I start dumping out the detail lines until their exhausted.  If 
there were enough remaining lines on the page for the totals they 
start from the bottom and work up.  If not a page eject is done and 
on the bottom (working up) of that new page I start feeding the totals.

I have never been off in the page of page count since day one !!

BTW there are upto 13 lines of totals (with the Grand Total of the 
Invoice) I can't off the top of my head list all of the detail 
subtotals, but they are things like: Labor @ Straight Time, @ 
OverTime, @ Premium (In place of Double-its user defined), 
Diagnostic Charges, Parts-Taxable, Parts-Non-Taxable, 
Sub-Contractors, Discounts-Labor and Materials, Tax, Shipping, etc. 
  Depending on the projects one to ALL can be used.  Thats is just 
one reason it is done in two passes, but it ALWAYS works.

Regards,
Keith
> 
> -----Original Message-----
> From: filepro-list-bounces+garyolman1=hvc.rr.com at lists.celestial.com
> [mailto:filepro-list-bounces+garyolman1=hvc.rr.com at lists.celestial.com] On
> Behalf Of George Simon
> Sent: Thursday, October 13, 2005 1:30 PM
> To: 'Kenneth Brody'; 'Christopher Yerry'
> Cc: 'List Filepro'
> Subject: RE: X of Y
> 
>>-----Original Message-----
>>From: filepro-list-bounces at lists.celestial.com [mailto:filepro-list-
>>bounces at lists.celestial.com] On Behalf Of Kenneth Brody
>>Sent: Thursday, October 13, 2005 12:34 PM
>>To: Christopher Yerry
>>Cc: List Filepro
>>Subject: re: X of Y
>>
>>Quoting Christopher Yerry (Thu, 13 Oct 2005 09:07:30 -0700 (PDT)):
>>[...]
>>
>>>My contentious comment:
>>>There is no reason page x of y is not in filepro this
>>>is 2005 not 1977.
>>
>>[...]
>>
>>And please explain how you can know how many pages will be printed
>>_before_ the report is generated.  Remember to take into account
>>subtotal breaks, records being printed multiple times (or not at
>>all) with PRINT statements, forced page breaks via PAGE, and non-
>>fixed-length records because of "remove unwanted blank lines".
>>
>>--
>>KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
>>http://www.hvcomputer.com
>>http://www.fileProPlus.com
>>_______________________________________________
>>Filepro-list mailing list
>>Filepro-list at lists.celestial.com
>>http://mailman.celestial.com/mailman/listinfo/filepro-list
> 
> I think this can be done rather easily by printing the report to a file,
> saving the total number of pages, changing the printer name to a line
> printer and then using the 'reset' command.  A little math is needed to get
> the correct page numbers because the 'reset' command does not reset the @pn
> value but it is rather simple to get the correct page number by deducting
> the total number of pages from the @pn value.  PN of TP - PN=@PN-TP
> It works for me and the reset command makes it happen so fast, it is almost
> transparent to the user.
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Keith F. Weatherhead                   keithw at ddltd.com

Discus Data, LTD                  Voice: (815) 237-8467
3465 S Carbon Hill Rd               Fax: (815) 237-8641
Braceville, IL  60407       Nat'l_Pager: (815) 768-8098
- - - - - - - - - - - - - - - - - - - - - - - - - - - -



More information about the Filepro-list mailing list