Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Remove Summary Band at runtime

edited August 2006 in General
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

Comments

  • edited August 2006

    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
  • edited August 2006
    That's pretty much what I have.

    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.


  • edited August 2006
    I have found the problem.

    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.


  • edited August 2006

    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
  • edited August 2006
    the other option is to set .Visible to false :-)

    --
    Ed Dressel
    Team DM
This discussion has been closed.