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

Suppress Grouping

edited October 2004 in General
I have built a report and created three groups one by date, another by part
number and then by supplier id.

My SQL sorts by one of these thre columns depending on how the user wants to
see the data.

I wanted to make the other two groups suppressed and only display and break
by the group they are ordering by.

I tried doing it by saying the groupheader and footer to visible := false
before I display the report.

The report doesnt display the header or footer but it still does a break on
the other groups?!

What is the proper way to turn the other two group by's off?

Thanks for any help.

-Jason





Jason J. Skala

Information Technology - Aspen Support

Development Programmer

(319)396-1234 EXT: 5296

Comments

  • edited October 2004
    Hi Jason,

    Setting the visibility of the group header and footer will not remove the
    group from the report. You will need to access the TppReport.Groups
    property to access the list of groups in your report. Then once you have
    found the correct group you would like to remove, you can use the
    TppReport.RemoveGroup method to disable it. If you plan to enable the group
    later down the line, you may need to make a copy of the object before you
    remove it. There are many other helpful group routines on the
    TppCustomReport object. See the ReportBuilder help for more information.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004
    how would you copy the object?

    I have the same questions as the original poster.

    I have for possible groups by four different sql statements.

    TIA

  • edited November 2004
    Hi Mojoala,

    I apoligise, "Copy" was the wrong word to use in this case. Once you remove
    a group from the FGroups TList, you will loose you ability to find this
    object again using this list. This means you will need to keep a reference
    to this object elsewhere if you plan to use it again. To correct my earlier
    post, instead of using the TppCustomReport.RemoveGroup method to disable a
    group, you can simply set the TppGroup.Report property to nil and achieve
    the same result. For instance...

    for liIndex := 0 to ppReport1.GroupCount - 1 do
    begin
    if ppReport1.Groups[liIndex].BreakValue = '1221' then
    begin
    lGroup := ppReport1.Groups[liIndex];
    lGroup.Report := nil;
    end;
    end;

    {Perform an operation with the group removed...}

    lGroup.Report := ppReport1;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004
    thanks I will try that.
  • edited November 2004
    I just don't get this

    for liIndex := 0 to ppReport1.GroupCount - 1 do
    begin
    if ppReport1.Groups[liIndex].BreakValue = '1221' then
    begin
    lGroup := ppReport1.Groups[liIndex];
    lGroup.Report := nil;
    end;
    end;

    {Perform an operation with the group removed...}

    lGroup.Report := ppReport1;

    I have four groups, when I pass in some variable,
    I want the group associated with the variable to be visible
    and the other 3 to be not visible.

    tia
  • edited November 2004
    Hello,

    Does the code below successfully remove the group from your report?
    Remember that when you reassign the Group.Report property, the group is then
    added to the end of the Report.Groups list so you may need to reposition it
    using one of the group methods.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.