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

total of 10 records only

Status
Not open for further replies.
Feb 16, 2001
44
CA
Hi,

I need to get totals of 10 records only. How can I do that?

I have a report where records groupped by branch. When branch is drilled down I have details for this branch - only 10 records which I got by cretating running total and counting number of records and if it 10 I am suppressing the rest details. Now I need to get totals for these 10 records. Is it any way to do that?

Thank you,
Julia
 
You want to have this total appear in the group footer, only when you drill down? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hello My suggestion would be to have a count formula in the section you have records in. Next, create a running total that you set the criteria for being {@count}=<10 The running total will only give you a total for the first 10 records.
Cheers,
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Hi,

Thank you for quich respond.

To Ken:
I want this total appear in group footer when I drill down and on summary page. I have details hidden and first page is group footer. When I drill down I get details, so want to have in both places.

To Bruce:
I've created count formula and placed it in details section where my records are. But I did not see this formula in the Fields Tree window of formula editor in Evaluate section when I tried to create running totals. How can I do that?

Thanks again.
Julia
 
Where is the summary page? Summary for the whole report? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken,

I have summary page as first of the report. On this page I have group footer , because I've hidden details. Then when i double click group footer I am getting details, something like this:

first page(summary page):

Branch Qty Sales Cost
NY 1 100.00 50.00
CA 30 1090.00 900.00

Then when I drill down(for example CA), I am getting detail page:

Model Qty Sales Cost
222222 1 10.00 5.00
.
.
.
.
Total for CA 30 1090.00 900.00

Since I need only 10 first records on the details, I would like to have totals for these 10 records, right now my totals for all records.

Thank you.
Julia
 
Hello Julia,
You have to use a manual running total.. not the expert due to evaluation issues.. this requires 3 formulas: a reset, an evaluation and a display formula.. Remember you also need to have your count formula in the detail section.. The formulas are as follows:
The initialize goes into your group header if this is 10 records per group, or report header if it is for the entire report. The evaluate will go into your detail section, and the display will go into either your group footer or report footer..

//@Initialize
//Assigns the RunningTotal variable an initial value of
//zero.
WhilePrintingRecords;
NumberVar RunningTotal;
RunningTotal := 0;

//@evaluate.. This will count your 10 records
WhilePrintingRecords;
NumberVar RunningTotal;
If {@count} <= 10
then
RunningTotal := RunningTotal + {yourfieldbeingsummedhere}
Else
RunningTotal := RunningTotal

//@Display
// Prints the cumulative value of the RunningTotal
// variable.
WhilePrintingRecords;
NumberVar RunningTotal;
RunningTotal;

Cheers,
-Bruce
Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
That means that your summary page has to be at the end. Running totals can't be seen until the report is done. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
To Bruce:

Thank you very much!
It is working perfectly.


Thanks again.
Julia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top