Calc SubReport values in Report Totals???

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?
 
M

Marshall Barton

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) - . . .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top