1
votes

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?

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