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!

Sub report sum formula needed

Status
Not open for further replies.

Jonesxx

Technical User
Jul 14, 2004
71
GB
Hi,

I am using Crystal version 8.5 to pull data from GoldMine version 6.7. I have a main report which has 4 unlinked subreports displayed on it. All of the reports (the main and sub reports) have a numeric field called contsup.zip entered on them. The contsup.zip field is entered in the Details section of each individual report, I need to be able to sum up all the contsup.zip entries of the subreports and enter this figure only once at the bottom of the main report.

For example if all the individual subreport contsup.zip entries amounted to 10 then the total I would want to show on the main report would be 40 (the total of all the sub reports). The contsup.zip entries on the main report, are to be displayed on the report but should be excluded from the final sum.

I think I may need to use some type of formula, which includes using a variable, formulas are not my strong point please help.

Thanks
 
In each subreport place:

whileprintingrecords;
shared numbervar TotSum;
TotSum:=TotSum + Sum(contsup.zip)

Then in the main report footer use the following to display the sum:

whileprintingrecords;
shared numbervar Totsum

-k

 
synapsevampire,

I get the following message when creating the formula in the sub reports.

whileprintingrecords ;
shared numbervar Totsum;
Totsum:=Totsum + Sum({CONTSUPP.ZIP})

The message basically says that a number field or currency amount is required and the cursor flashes just after the first bracket of the contsupp.zip field.

Any ideas? Thank v m
 
That means that your field is not a number. Check its datatype by allowing the mouse to hover over the field. Then create a formula to convert it, maybe {@zip}:

tonumber({contsupp.zip})

Then use {@zip} in place of the field in SV's formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top