sum in sub report

Mike Hughes

Registered User.
Local time
Today, 20:43
Joined
Mar 23, 2002
Messages
493
I have a report with two sub reports. What I want to do is sum the numbers from each column from each report to get a grand total.
I have attached two pictures which will hopefully help someone understand what I'm trying to do.
 

Attachments

  • Picture 1.jpg
    Picture 1.jpg
    92 KB · Views: 137
  • Picture 2.jpg
    Picture 2.jpg
    17.1 KB · Views: 145
You will need to add the Sum() function in the Report Footer section of each subreport, then on the main report refer to the totals textboxes from earlier. Use the Code Builder to get the correct syntax.
 
I'll give it a try, thanks.
 
That didn't work. Could someone look at the attached DB and show me how to get a grand total from the original report and two sub reports. Thanks Mike
 

Attachments

Tell us what errors are you getting? And how you went about setting it up.
 
REPORT 2
IN THE REPORT FOOTER =sum([OA_CASES]) FOR THE FIRST COLUMN AND EACH OF THE OTHER COLUMNS.

REPORT 3
IN THE REPORT FOOTER =sum([SA_CASES]) FOR THE FIRST COLUMN AND EACH OF THE OTHER COLUMNS.

Then on the report containing all the sub-reports I’m trying to sum each column in the REPORT FOOTER, PA_CASES, OA_CASES & SA_CASES for each of the columns.

For column 1 on the footer of the report (including sub reports) I put something like this:

=sum(=sum[PA_CASES]) + =sum[OA_CASES]) + =SUM([SA_CASES]))
When I try this I get an error on the report in this field
 
I'll also attache a screen shot of the report (with sub reports) which might give you a better idea of what I'm trying to do. Thanks for any help you could give. Mike
 

Attachments

  • REPORT DESIGN VIEW.jpg
    REPORT DESIGN VIEW.jpg
    99.5 KB · Views: 127
Looking at your attachment I don't see where you've put the =Sum() in the Report Footer section of the subreport. It needs to be placed there. Then call the txtbox something like txtTotalSA_Cases.

Then in the Footer section of your main report, use the Expression Builder to find the textbox and get the correct reference. Note in this step I didn't mention using Sum().
 
No Mike I can't. But I bet it's a wide smile, something like this --> :D
 
Just one more question. See screen shot

Thanks Mike
 

Attachments

  • CASELOAD REPORT.jpg
    CASELOAD REPORT.jpg
    32.9 KB · Views: 117
They textboxes do not have to be placed in the Report Footer section. They can be placed right after the subreport if the subreport is not placed in the Detail section.
 
I have the subreports in the Detail section, should they be somewhere else and where?
 
In that case the textboxes can only be placed in the Footer section.

The other thing you can do is create a subreport of your subreports and place the textbox just below the newly created subreports in the Detail section.
 
OK, thanks again and I think I'll keep them where they are. Mike :D
 

Users who are viewing this thread

Back
Top Bottom