2

I have a (repeating) detail band, and attached to it is a child band:

enter image description here

I want to have the child band hidden, until it is printing the last detail band. Conceptually it would be something like:

enter image description here

EOF?

My first thought was to check the .EOF property of the data set; you can be on the data row, but it will still be EOF:

procedure TForm6.DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean);
begin
    // Print our child band if we're the last detail band:
    ChildBand1.Enabled := QuickRep1.DataSet.EOF;
end;

But it never happens that .EOF is true.

Perhaps the BeforePrint happens before the internal .Next happens, so instead i try AfterPrint:

procedure TForm6.DetailBand1AfterPrint(Sender: TQRCustomBand; BandPrinted: Boolean);
begin
    // Print our child band if we're the last detail band:
    ChildBand1.Enabled := QuickRep1.DataSet.EOF;
end;

But .EOF is never set.

How can I detect that the last detail band is printing?

So the question becomes:

How can i detect that the last rbDetail band is printing?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • 1
    In theory, what you could do in Onbeforeprint is, create a bookmark, advance the dataset and then test for EOF, then return to the bookmark. – whosrdaddy Mar 18 '19 at 21:54

1 Answers1

0

I had the same issue and I solved it by setting the DetailBand1.FooterBand property to ChildBand1.

This results in ChildBand1 being displayed once after all of the repeating DetailBand1 items have been displayed.

w5m
  • 2,286
  • 3
  • 34
  • 46