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!

Grand Total for Calculated Fields

Status
Not open for further replies.

vsharma79

Programmer
Aug 22, 2002
15
AU
Hi!

I have a column in my report , which is a calculated column. to be more specific and clear, here is the example

Col1 Col2 Col3
1 4 33.33
2 6 66.66

Total 3 10 99.99

Col3 = Col1/total * 100 (for each row) ex 1/3 * 100

For some reason I cannot get Crystal to generate a Grand Total for col3, as it does for the other 2 columns. If I right click on Col3, I do not get the insert option and if I try to create a formula, I get the following error message "The summary / running total field could not be created".
Has anyone got any ideas about this and how to get the total for col3. I would highly appreciate your response(s).

Vik
 
I've had the same problem. Crystal is more a reporting tool than a programming language and does not give programmers full control over totals and work fields. Crystal 8.5 prevents you making certain links, which presumably don't fit with its mode of processing.

You can get the same result by calculating the Col3 total on the basis of your other grand totals. Or even using a second formula to accumulate the value for each row and then print it at the end.

If there's a better way, it would be very useful to know about it. Madawc Williams
East Anglia
Great Britain
 
Thanks for your response mate. Lets wait and see if someone else has any better ideas.
 
Hi,
You need to create a formula as {@TotPercentage} :-
Global numberVar x := x + col3;
and place it in the same section where you are displaying other cols.Suppress this formula.
Place one more formula at the report footer as GrandTotal
numberVar grandsum := grandsum + {@TotPercentage} ;

Tell me if this works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top