Delete group band, group header, group footer, at run time?
I had a thought that would greatly simplify my report with variable
numbers of variable groups.
I would create a report with one detail band, 7 groups (group bands,
headers, and footers), and place all the labels in the right places
using the designer. They would each have their own method for the
beforegenerate event.
Then if the user selected fewer than 7 groups, I would delete the extra
ones from the outside in.
On this report, I have decided that even the detail band is going to be
all labels and have its data filled in via the detail band
beforegenerate or (ontraversal?) event.
The individual group beforegenerate events will each call their own
method, which will then just call a generic procedure with the right
parameters to specify the group level. The generic procedure will
include the records it has been told to include while calculating the
detail or group numbers.
That way I can have the same code print details or group calculations,
and it will just be a matter of how many records and which records get
looked at by the method.
All I need then to do that I haven't done before is to delete a group
band, header, and footer. Do I delete the header and footer bands first
before the group band?
numbers of variable groups.
I would create a report with one detail band, 7 groups (group bands,
headers, and footers), and place all the labels in the right places
using the designer. They would each have their own method for the
beforegenerate event.
Then if the user selected fewer than 7 groups, I would delete the extra
ones from the outside in.
On this report, I have decided that even the detail band is going to be
all labels and have its data filled in via the detail band
beforegenerate or (ontraversal?) event.
The individual group beforegenerate events will each call their own
method, which will then just call a generic procedure with the right
parameters to specify the group level. The generic procedure will
include the records it has been told to include while calculating the
detail or group numbers.
That way I can have the same code print details or group calculations,
and it will just be a matter of how many records and which records get
looked at by the method.
All I need then to do that I haven't done before is to delete a group
band, header, and footer. Do I delete the header and footer bands first
before the group band?
This discussion has been closed.
Comments
The bands will get removed automatically:
ppReport1.Groups[i].Free;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com