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!

Formulas not showing up under Report Field 1

Status
Not open for further replies.

sjp0362

Technical User
Oct 23, 2004
48
US
Using Crystal Reports 9.2
Modifying some reports that came with our new software.

My Problem.
I have a formula in a Group Footer. Now I would like to add a summary of that formula at the bottom of my report in the report footer. When I go to "Insert Summary", my formula doesn't show up under the "Report Field" area--all I see are the tables and fields available.

I have modified other reports and my new formulas have shown up for me to Summarize.

Any ideas?

Here's my formula:
if {@Percent}>0
then (Sum ({JCCD.ActualCost}, {JCCH.CostType})/{@Percent}*100)
else
if Sum ({JCCD.EstCost}, {JCCH.CostType})>Sum ({JCCD.ActualCost}, {JCCH.CostType})
then Sum ({JCCD.EstCost}, {JCCH.CostType})
else Sum ({JCCD.ActualCost}, {JCCH.CostType})
 
You can't insert summaries on formulas that contain summaries, but you can summarize them using a variable. If you want to add the summaries to get a grand total, then create two formulas:

//{@accum} to be placed in the group (cost type) footer:
whileprintingrecords;
numbervar grtot := grtot + {@yourgrpformula};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

-LB
 
Thanks! This worked in my first situation.

Now we would like to create another report in which the column will be broken down more (by contract item) and subtotaled.

I inserted another group. How can I get the running total that is in this column to enter a subtotal and then re-start at zero for each new section? Any ideas?
 
Not sure what you are saying. Your formula (in the first post) is a summary at the cost type group level. Are you now inserting a second group (contract item) nested within the cost type group? If so, I think you would have to change your formula to reflect the inner most group, as in:

if {@Percent}>0
then (Sum ({JCCD.ActualCost}, {JCCH.ContractItem})/{@Percent}*100)
else
if Sum ({JCCD.EstCost}, {JCCH.ContractItem})>Sum ({JCCD.ActualCost}, {JCCH.ContractItem})
then Sum ({JCCD.EstCost}, {JCCH.ContractItem})
else Sum ({JCCD.ActualCost}, {JCCH.ContractItem})

Then you would have four formulas:
//{@reset} to be placed in the cost type group header:
whileprintingrecords;
numbervar costtypesum := 0;

//{@accum} to be placed in the group (contract item) footer:
whileprintingrecords;
numbervar costtypesum := costtypesum + {@yournewformula};
numbervar grtot := grtot + {@yournewformula};

//{@displcosttypesum} to be placed in the group (costtype) footer:
whileprintingrecords;
numbervar costtypesum;

//{@displaygttot} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top