Remove Summary Band at runtime
I am having a hard time removing the Summary band from the report at
runtime.
In the code I have a section that removes certain groups if they are not
required.
That works OK, so immediately after that I tried to remove the summary band
but it does not work and the summary band always prints, no matter what.
I even tried setting the Visible property to false at design time, but that
does not work either.
// this works
myReport.Groups[ReportGroupIndex].Free;
// this has no effect
myReport.SummaryBand.Free;
How can I hide or remove the Summary band at runtime?
Peter
runtime.
In the code I have a section that removes certain groups if they are not
required.
That works OK, so immediately after that I tried to remove the summary band
but it does not work and the summary band always prints, no matter what.
I even tried setting the Visible property to false at design time, but that
does not work either.
// this works
myReport.Groups[ReportGroupIndex].Free;
// this has no effect
myReport.SummaryBand.Free;
How can I hide or remove the Summary band at runtime?
Peter
This discussion has been closed.
Comments
I tried a simple example here and it works great. I created a report with a
summary and then I coded
ppReport1.SummaryBand.Free;
ppReport1.Print;
The report generates without a summary band.
Try creating a simple test like that...
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Since it does not seem to work I thought that there was some other property
that needed to be set or that I had to remove all child components first.
Obviously that is not the case.
I am using the report template and unlike groups, the summary band has to be
removed _after_ the template is loaded.
This wasn't immediately obvious, because removing the groups works even
before the template is loaded.
Aha, yes the template 'is' the report definition - it's the equivalent of
the '.doc' file for an MS Word document. In MS Word you would open the .doc
file and then modify it. So yes, you need to load the template and then
modify the report layout.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
--
Ed Dressel
Team DM