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

Group Footer Band

edited June 2012 in General
Hi,
i have a group footer band with a Line component.
How do not print group footer band in the last records ?

Example :
1
1
1
-------- line in footer band
2
2
-------- in the last is possible not print ?

Thank you
Regards

Comments

  • edited June 2012
    Il 19/06/2012 17:55, Mauro Catellani ha scritto:

    Hi,
    the problem is on RAP.

    I post in a wrong newsgroup,
    the right newsgroup is digital-metaphors.public.reportbuilder.rap

    Sorry to mismatch.

    Bye
  • edited June 2012
    Hi Mauro,

    This can be done with a two pass report. During the first pass inside
    the Group.AfterBreak event, increase a global variable keep track of the
    total group breaks. Note that the code below is rough psuedo code and
    may need to be changed for your specific report.

    procedure Group1AfterGroupBreak;
    begin
    if Report.FirstPass then
    gGroupBreakCount := gGroupBreakCount + 1;
    end;

    Then during the second pass inside the GroupFooter.BeforePrint event
    check to see that the total group break count is equal to the current
    break number - 1 then assign the visible property of the line.

    procedure GroupFooterBand1BeforePrint;
    begin
    if Report.SecondPass then
    begin
    if Group1.BreakNo = gGroupBreakCount - 1 then
    Line1.Visible := False;
    end;

    end;


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2012
    Il 19/06/2012 22:02, Nico Cizik (Digital Metaphors) ha scritto:

    Hi Niko,
    some problems about the code you sent me :

    1) I forgot to tell you that the group is in a subreport. Is the same ?

    Howevere I try to write the following code in a SubReport:

    In the section GlobalVariables of the subreport i define the following
    global variable :

    var
    gGroupBreakCount: Integer;

    and then i put the code you sent me in the event group :

    procedure Group5AfterGroupBreak;
    if Report.FirstPass then
    gGroupBreakCount := gGroupBreakCount + 1;
    end;

    line 1 procedure GroupFooterBand5BeforePrint;
    line 2 begin
    line 3 if Report.SecondPass then
    line 4 begin
    line 5 if Group5.BreakNo = gGroupBreakCount - 1 then
    line 6 Line7.Visible := False;
    line 7 end;
    line 8 end;

    The compiler show me an error :

    Error GroupFooterBand5BeforePrint: line 5, incompatible types

    Any suggestions ?

    Thank you
    Mauro Catellani
  • edited June 2012
    Try placing the gGroupBreakCount - 1 in parentheses.

    if Group1.BreakNo = (gGroupBreakCount - 1) then
    ...

    Be sure you set the PassSetting of the report to psTwoPass.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2012
    Il 21/06/2012 00:03, Nico Cizik (Digital Metaphors) ha scritto:
    Hi Nico,
    i try placing the gGroupBreakCount - 1 in parentheses and
    haven't compiling error.
    But i have a problem with the last record.
    You can omit the dot line in the AfterFooterGroup when the last group is
    printed ?
    Here is an example :
    1
    1
    1
    -------- dot line in footer band
    2
    2
    -------- dot line in footer band
    3
    3
    -------- in the last is possible not print the line ?

    Thank you
    Mauro
  • edited June 2012
    Are you certain you set your report to two pass?

    Below is a link to the simple example I created. Notice that the line
    disappears for the last group.

    http://www.digital-metaphors.com/tips/HideLastGroupLine.zip

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2012
    Il 22/06/2012 18:09, Nico Cizik (Digital Metaphors) ha scritto:

    Hi Nico,
    i have seen that your simple example works fine.
    However, my report does not work.
    The difference between my report and your example is that the group, in
    my report, is in a subreport.
    I set two pass either in report and subreport.
    Any suggestions ?

    Thank you.
  • edited June 2012
    I will need to see this in action. Please either alter the example I
    sent you or create a simple example of your own I can run here so that I
    can see the behavior you are describing.

    Send the example in .zip format to support@digital-metaphors.com.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2012
    Il 25/06/2012 22:07, Nico Cizik (Digital Metaphors) ha scritto:
    Hi Niko,
    i send you the example in .zip format to support@digital-metaphors.com.

    Best regards.
This discussion has been closed.