Groups with subtotals.
Hi,
I have a simple report of students grouped by class. In the group footer I
would like to print the number of boys and girls and total students. I am
having trouble doing this. I tried defining global variables for the totals
and
then adding 1 when if prints each and resetting to zero after the print of
the
total students. This works unless I perview and go to the next class and
then do a prior page. I tried to move the reset to zero into the heading of
the group. But to only zero it out on the first page of a group do I check
Overflow or what?
Do I need to cache pages?
Thanks,
Joseph Gordon
I have a simple report of students grouped by class. In the group footer I
would like to print the number of boys and girls and total students. I am
having trouble doing this. I tried defining global variables for the totals
and
then adding 1 when if prints each and resetting to zero after the print of
the
total students. This works unless I perview and go to the next class and
then do a prior page. I tried to move the reset to zero into the heading of
the group. But to only zero it out on the first page of a group do I check
Overflow or what?
Do I need to cache pages?
Thanks,
Joseph Gordon
This discussion has been closed.
Comments
You might try a different approach: add 2 calculated fields, 'IsBoy',
'IsGirl' that are 0/1 for F/T. Then put the fields in your detail band but
set their visiblity to false. Then put a calculated summary in the footer
band.
Ed Dressel
Team DM
The problem with that is that a user can't add these calculated fields. I
can add them to the table for them, but then what if the user wants the to
count
the number that are xyz, etc. I had hoped that I was just missing something
since this seems like a common thing you would want to do in a report.
I tried turning CachePages to true and that did not work either.
The last thing I am going to try is adding a TStringList and store off the
Absolute
page number all the counts so that if you go back to that page it can get
the
correct number back. But, this seem like a lot of work.
I'm just curious, most reporting programs I have used generate the report to
memory or to a file and then you can preview or print that representation,
rbuilder seems to regenerate every page as you move, what advantage does
that gain?
Joseph Gordon
to
You can cache them (Cache = True).
Ed Dressel
Team DM