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

Group total and single record

Status
Not open for further replies.

kthacher

Technical User
Jun 25, 2003
17
US
I have a report capturing transactions by account (many transactions per account). The group footer is a subtotal by account. I want to compare each subtotal to the budget for the account. The budget is in a different database file and has only one record per account. If I put the budget in the detail lines, it repeats for each transaction. Even if I don't put it in the detail lines and just put it in the group footer it still multiplies the budget times the number of records retrieved for each account. How can I put the budget in the group footer and just get the single record?

Thanks in advance and my apologies if this has already been asked and answered--I did check where I could.
 
You can get at the budget using a subreport, and use a Shared Variable to pass the value back to the main report. Note that this will need to be done in the group header, since the results of a subreport are only available to lower sections and not to the section where the subreport is run.

The subreport need not have any visible ouput, or it can be suppressed. And it would also be possible to split Group Footer into sections, placing the subreport in one and using its output in the next.

(For the use of Shared Variables, do a Keyword Search hear and at forum767 to get details of Variables and Shared Variables, which are very awkward versions of 'working storage' or 'data storage' in other languages.)

Madawc Williams
East Anglia, Great Britain
 
How were you putting the Budget in the group footer? it sounds like you were creating a summary field. Don't....

If you place the budget field in the group footer, it should only show you the value of the last record in the group.

Reebo
Scotland (Sunny with a Smile)
 
If you place the budget in the Group Footer, you will still get duplicates if you try to do a grand total or a total for a larger group. For these you would use an running total field, set to evaluate 'once per group'.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top