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

new problem with making grand total from formulas

Status
Not open for further replies.

sorchard2000

Technical User
Aug 3, 2004
57
US
My original problem was:
I am finishing up a Crystal 8.5 report and have a formula called @TotalPtCharge (see following) that show currency charge for a patient bill. This formula resides in a group footer on the main report.
{@MainFormula}+{@MainFormula2}+Sum ({@editedChargeAmt}, {casemain.pat_acct_num})
@MainFormula and @MainFormula2 are references to formulas that are coming off of 2 different subreports.

I need to do a grand total of this formula for all patients listed. But whenever I try to do a Insert>Grand Total OR Insert>Summary OR a running total, the formula is not listed (recognized) as a field. I'm not sure what to do at this point--another formula?
********
So I followed bdreed35's advice (which worked successfully) and changed my formulas to:

bdreed35 (Programmer)
You are going to need to manually accumuate the patients totals.

Modify your Group Footer formula to this:

CODE
whileprintingrecords;
local currencyvar patient_total := {@MainFormula}+{@MainFormula2}+Sum ({@editedChargeAmt}, {casemain.pat_acct_num});
currencyvar grand_total := grand_total + patient_total;
patient_total

Create a new formula to display the grand_total variable:
CODE
whileprintingrecords;
currencyvar grand_total;

Place the formula in your report footer.
**********
I used his code to make subtotal for each patient (each group).
So now I need to make a final, grand total field in the footer which reflects all the subtotals for the entire report. But everything that I have tried so far has failed.

Any ideas?
Thanks in advance!



 
Bdreed35 already gave you the answer you need. The first formula goes in the group footer, and provides the subtotal per patient. The second formula goes in the report footer and provides the grand total.

If these are not working, you should provide the contents of the formulas within your formula and also provide a sample of the results you get when you try bdreed35's solution so we can see why it is not working.

Please note that you should have stayed within the initial thread.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top