View Full Version : Calculating Fields in SubReports?


Billie
01-30-2002, 02:32 PM
Hello, I was just wondering if there was a way to calculate through sub reports. I finally got my information from all three tables to show on the same report correctly. I did add 2 subreports to my report. Now, I need to take a number from my initial report and add that to a number in my first subreport and then subtract that from a number in my second subreport. Is there anyway of doing that?

D B Lawson
01-30-2002, 03:14 PM
In the page footer of each sub report do your calculation. In the main report create two unbound text fields and reference the calculation fields in each of the subreport footers. IE: (without quotes) "=[subreportname].Report![FieldinSubreport]"

Once you have those showing the correct results on the main report, you can just do another unbound field that adds your main report field to the field with the calculation for the first subreport, ie "=[MainReportField]+[SubReportField] and then create another (!) unbound field which subtracts that total from the calculation from the second subreport. Obivously the text within the [] should be your own field names.