GroupFooter Height

FAlvaradoFAlvarado US/Mexico
edited 6:21PM in FastReport VCL 5
Hi all:
How can I set the height of the group footer in code to accommodate only the visible items?
this procedure works and set visible the memos:
procedure frxDBDataset1SubContractor1OnBeforePrint(Sender: TfrxComponent);
begin
frxDBDataset1SubContractor1.Visible := Length(<frxDBDataset1."SubContractor1">) > 0;
frxDBDataset1SubContractor2.Visible := Length(<frxDBDataset1."SubContractor2">) > 0;
...
end;

.. but this is not working!
procedure GroupFooter1OnAfterPrint (Sender: TfrxComponent);
begin
GroupFooter1.Height := 0.90;
if frxDBDataset1SubContractor1.Visible then
GroupFooter1.Height := GroupFooter1.Height + 0.20;
if frxDBDataset1SubContractor2.Visible then
GroupFooter1.Height := GroupFooter1.Height + 0.20;
...
end;

OnAfterCalcHeight and OnBeforePtint events don't work either...
Any suggestions?
Best Regards
Francisco Alvarado

Comments

  • edited 6:21PM
    Good morning,

    try something like this in OnBeforePrint:
    if tfrxmemoview(sender.parent.findobject('frxDBDataset1SubContractor1')).visible then
    

    greetz
  • FAlvaradoFAlvarado US/Mexico
    edited 6:21PM
    Good morning,

    try something like this in OnBeforePrint:
    if tfrxmemoview(sender.parent.findobject('frxDBDataset1SubContractor1')).visible then
    

    greetz
    I tried that but the GroupFooter is overlapped by the next section (GroupHeader).
    Thank you
    Francisco Alvarado
  • gordkgordk St.Catherines On. Canada.
    edited 6:21PM
    try this attach a child band to the group footer place the memos you want hide in the child band
    write coden to hide the child band
  • FAlvaradoFAlvarado US/Mexico
    edited 6:21PM
    gordk wrote: »
    try this attach a child band to the group footer place the memos you want hide in the child band
    write coden to hide the child band
    Thank you! That worked!
    Francisco Alvarado

Leave a Comment