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

Summing customized Group Totals in Report Footer 1

Status
Not open for further replies.

durshpee

Technical User
Jun 18, 2010
2
US
thread767-1567866

I needs some help with creating a Report Footer formula that will sum up my group totals.

I have a formula in my group totals that gives me a custom group total depending on the group name.

For example; I have 3 Area Types. These areas have associated acreages that we bill for.

Depending on the AreaType, the billable area acreage would change.

So,
for my Group Footer total formula, I have the following:

if GroupName ({ImperviousArea_AreaType.Description}) = "Treated Areas"
then Sum ({IMPERVIOUSAREA.IAAcreage}, {ImperviousArea_AreaType.Description}) / 2 else
if GroupName ({ImperviousArea_AreaType.Description}) = "Untreated Areas"
then Sum ({IMPERVIOUSAREA.IAAcreage}, {ImperviousArea_AreaType.Description}) else
if GroupName ({ImperviousArea_AreaType.Description}) = "Sewer Discharge Areas"
then 0

I would like to add the group totals together in my Report Footer to get a Grand Total acreage areas after discount.

I have tried creating individual formulas for each of the "if" statements above and then creating a grand total formula that takes each individual formula and adds them together. This doesn't seem to work for the formula where I divide by 2, at least not when I add it to the Report Footer.

I am referencing a thread that I believe was similar, but being new to Crystal Reports, I need more help.

Please let me know if there is an easy way to resolve my issue.
 
Create two formulas:

//{@accum} to be placed in your group section (header or footer) and suppressed:
whileprintingrecords;
numbervar acreagetotal := acreagetotal +
(
if {ImperviousArea_AreaType.Description} = "Treated Areas"
then Sum ({IMPERVIOUSAREA.IAAcreage}, {ImperviousArea_AreaType.Description}) / 2 else
if {ImperviousArea_AreaType.Description} = "Untreated Areas"
then Sum ({IMPERVIOUSAREA.IAAcreage}, {ImperviousArea_AreaType.Description}) else
if {ImperviousArea_AreaType.Description} = "Sewer Discharge Areas"
then 0
)

Or (choose one way) you could just reference your group footer formula, as in:

whileprintingrecords;
numbervar acreagetotal := acreagetotal + {@yourgroupfooterformula};

In the report footer, add this formula to display the result:

whileprintingrecords;
numbervar acreagetotal;

-LB
 
lbass,

Thank you very much. This works great...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top