Calc SubReport values in Report Totals???

  • Thread starter Thread starter ChrisP
  • Start date Start date
C

ChrisP

I have a Report which contains 2 subreports.

I want to calculate the values from the subreports if any
exist. The one subreport shows parts and their cost if
any were used. The other subreport shows the discounts if
any were used.

My report is a service bill basically.
I want to calculate the Total by adding up the parts
cost, if used, and then subtracting all the discounts, if
any. Then displaying it in a Totals textbox.

How can I do this?
 
ChrisP said:
I have a Report which contains 2 subreports.

I want to calculate the values from the subreports if any
exist. The one subreport shows parts and their cost if
any were used. The other subreport shows the discounts if
any were used.

My report is a service bill basically.
I want to calculate the Total by adding up the parts
cost, if used, and then subtracting all the discounts, if
any. Then displaying it in a Totals textbox.


You can use a text box in each subreport to calculate the
totals. The text box expression would be something like:

=Sum(costfield)

Then the main report totals text box can refer to the
subreport values with this kind of expression:

=subreport1.Report.total1 - subreport2.Report.total2

If there's any chance that a subreport may not have any data
(and hence no total), then use this to test for that
situation:

=IIf(subreport1.Report.HasData, subreport1.Report.total1,
0) - . . .
 
Back
Top