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

Formula that calculates from separate subreports? 1

Status
Not open for further replies.

random621

Technical User
Jul 16, 2003
54
US
I have a report that contains 2 subreports. One subreport shows sales contracts filled for a particular commodity. The other subreport shows insurance reimbursement received for the same commodity.

Each subreport has a "total" value. On the main page of the report I would like to add a formula field that sums each of the total value fields in the subreports.

Is this possible? And if it is, how can it be accomplished?

Thanks.

 
hi
Sorry cant be done
have you try making a summary

pgtek
 
Pgtek -

I had not considered a summary. How do you think one might work in this case?
 
Hi
since your making a total value base on the report
but you cant have a sub report in a sub report
you have your sub report link base on a commom field of the main report

cheers

pgtek
 
Yes, of course, you can total results from subreports in the main report. Within each subreport, you need to write a formula which defines the total as a shared number variable, as in:

In subreport 1:
shared numbervar sub1total := sum({table.amount}, {table.ID}) //where {table.ID} is a group field within the subreport, otherwise omit

Repeat for subreport 2 with a different name for the shared variable. Then in the main report, for simple addition of the two, create a formula:

shared numbervar sub1total + shared numbervar sub2total

The formula would need to be placed in a section below the section where the subreports appear, e.g., if the subreports are in group footer 1, then insert a section group footer 1b and place the formula in that.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top