Joined: 10 Jun 2010
Location: United States
Online Status: Offline
Posts: 33
Topic: Counts that include sub-report? Posted: 24 Jul 2013 at 6:23am
I have a report that is pulling a company roster. Some of the employees work for a branch so I had to do a sub-report to pull them. How do I do a count of employees using the information from the main report AND the sub-report.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 24 Jul 2013 at 6:29am
shared variables.
in the subreport you could have a line like:
shared numbervar empCount;
empCount := COUNT({table.field});
"" // this will hide the output, though you might want to display it.
Place the formula in the report footer or a group footer...whichever seems correct.
Now in the main report, create a formula like:
shared numbervar empCount;
count({table.field}) + empCount
This will display the total from the main report, plus the value from the subreport.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 25 Jul 2013 at 4:44am
different variables.
if you want to see the totals of the main and the subreport based on the grouping, put the formula in the group footer.
you will need to modify the formula slightly to be like:
count({table.field}, {grouping value})
the {grouping value} should be available as a report value, it might be a formula or it might be a field...since i don't know how the report was written.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum