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

how to sum the amount for group

Status
Not open for further replies.

EngJoo

Programmer
May 14, 2002
90
MY
Hi all,i hope Cr can perform such operation.Please advise

my scenario is before i group my report preview is like below

eg : A

Cust_no Amount

1234 100.00
1234 100.00
1333 50.00
1555 200.00
1555 200.00

after i group Cust_no then i entire to get

eg. B

Cust_no Amount

1234 100.00
1333 50.00
1555 200.00

so my question is when i sum the amount, the subtotal that i get is 650.00( which is the sum of amount on eg A) but the real figure that i want is sum of amount on eg B (which is 350.00)

please advise.

Thank you in advance

 
hi,
i understand that you probably want sum before printing. as i have crystal report 8.5 enterprise version. in that you follow these steps :
1. open the report in crystal report environment.
2. right click on the sum field.
3. select change summery option.
4. click check box show as percentage of .
5. select grand total of the field from list box .
and this will do your work, i hope so....

Mehul Ajmera
 
Insert a running total field and use the 'evaluate' setting to tell it to evaluate 'once per group'. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
How to evaluate 'once per group'?
i only can see 'on change of group' on the running total field.
Please advise
 
On change of group means once per group. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
If you are working with a version of crystal that is lower than 7, you do not have the option of using the running total expert, and will need to create a manual running total.
Try This:
Running Total Formulas with Groups:

The following formulas create a subtotal based on the change of a Group. This example assumes a sales database is grouped and sorted in order of country. The first formula declares the variable and resets the variable to zero when the country changes. The second formula calculates the subtotals and grand total for each record. The third formula displays the subtotal for each country. The fourth formula displays the grand total for all the records in the report.

Formula 1
This formula resets the variable to 0 each time the country changes. Place this formula in the Group Header section. This formula is crucial to the calculation but it does not need to be displayed and the formula field can be formatted to ‘Hide When Printing’.

@CountryReset (this is the formula name, it is not part of the formula)

WhilePrintingRecords;
CurrencyVar SubTotal := 0

Formula 2
This formula calculates the sub totals and grand total. Place this formula in the Details section of the report to make sure all records are evaluated to accumulate a total.

@DetailFormula (this is the formula name, it is not part of the formula)

WhilePrintingRecords;
CurrencyVar SubTotal;
CurrencyVar GrandTotal;
GrandTotal := GrandTotal + {company.LastYrSale};
SubTotal := SubTotal + {company.LastYrSale}

Formula 3
This formula displays the final value of the SubTotal variable for each country. Place this formula in the Group Footer section. When a group change occurs, SCR begins at the Group Header again and this executes the @CountryReset formula which resets the SubTotal variable to 0 for the next country.

@ShowSubTotal (this is the formula name, it is not part of the formula)

WhilePrintingRecords;
CurrencyVar SubTotal;
SubTotal

Formula 4
This formula displays the grand total of all the records in the report. Place this formula in the Report Footer section to print the accumulated final total. The GrandTotal variable does not reset with each group change as the value continually increments until the report ends.

@ShowGrandTotal (this is the formula name, it is not part of the formula)

WhilePrintingRecords;
CurrencyVar GrandTotal;
GrandTotal

Cheers,
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top