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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert subtotals after every 24 records?

Status
Not open for further replies.

Corres

Technical User
Jun 13, 2006
87
CA
CRXI

Hello,
Please give me idea how I can insert subtotals after each 24 records of the report?

Thank you for your time!
 
hi,

What makes 24 the magic number?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
It can be actually 25. The data with subtotals has to be then placed in special templates that allow a limited number of rows.
 
There are 2 possibilities here, depending on whether the "Sub Total" is a running total of all records to date, or a total of only those records since the previous Sub Total.

Scenario 1 (Sub total - all records)
Create a second Details section and insert a Running Total.

Then Conditionally Suppress the "Details b" section using the following code:

Code:
Remainder(RecordNumber,24) <> 0

Scenario 2 (Sub total - records since previous sub total)

Create a second Details section and insert the following formula:

Code:
WhileprintingRecords;
Global NumberVar x := x + {Table.Data}

In the conditional suppression formula for "Details b" section inert the following code:

Code:
WhileprintingRecords;
Global NumberVar x;

If      Remainder(RecordNumber,24) = 0
Then    x := 0
Else    x := x;

Remainder(RecordNumber,24) <> 0

Hope this helps.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top