Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detail lines rolling over to the next page

Status
Not open for further replies.

iwm

Programmer
Feb 7, 2001
55
US
My report can accommodate 5 detail lines per page. The 6th detail line should print on the next page. Under normal circumstances I would do this by applying the following logic in the Section Expert>Common>New Page After:

Whileprintingrecords;

(RecordNumber mod 5) = 0

The fields I am working with are ACCOUNT#, CODE, AMOUNT. I am sum the AMOUNT field when the ACCOUNT#/CODE are the same, listing the ACCOUNT# and CODE only once. I am also using the Format Editor to suppress where duplicated.

For Example -
(Before sum based on ACCOUNT#/CODE being the same and suppressing where duplicated):

ACCOUNT# CODE AMOUNT
123456 ABC $50.00 (record #1)
246810 XYZ $75.00 (record #2)
123456 ABC $50.00 (record #3)
123456 ABC $50.00 (record #4)
123456 ABC $56.00 (record #5)
246810 XYZ $25.00 (record #6)
567829 QRS $100.00 (record #7)

(After sum based on ACCOUNT#/CODE being the same and suppressing where duplicated)

ACCOUNT# CODE AMOUNT
123456 ABC $206.00 (record #1, #3, #4, #5)
246810 XYZ $100.00 (record #6, #2)
567829 QRS $100.00 (record #7)


If I use this logic-

Whileprintingrecords;

(RecordNumber mod 5) = 0

The record #7 will print on this 2nd page. I need it to printing on the first page. Even though technically it is the 7th record, after I sum the AMOUNT field it becomes the 3rd detail line and should print in the number 3 position on the first page not the number 7 position on the 2nd page.

Your assistance in this matter is greatly appreciated.
 
I'm assuming that you are inserting a group on Account# or on a concatenation of Account# + code (if the code can differ per account#). So you might be able to use groupnumber instead of recordnumber in your mod formula. However if you have other groups, you might want to insert a running total {#grpcnt}instead, which does a distinctcount of your concatenation formula, evaluate on change of group {@concatenation}, reset never (or on change of higher order group, if it exists. Then use the running total in the new page after formula area:

remainder({#grpcnt},5) = 0

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top