I have the following code
procedure Tar_ardemo.qr_ardemoBeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
var
QR: TquickRep;
QB2: TQRBand;
QB3: TQRChildBand;
QL: TQRLabel;
begin
with artikste do
begin
close;
sql.Clear;
sql.add('SELECT * FROM Artikels');
open;
first;
end;
QR := qr_ardemo;
QB2 := QRBAND2;
QB3 := TQRchildband.Create(QR);
QB3.ParentBand := QB2;
QB3.Height := 40;
QL := TQRLabel.Create(QR);
QL.Parent := QB3;
QL.Left := 300;
QL.Top := 1;
QL.Width := 81;
QL.Height := 23;
QL.Caption := 'QRLabeZZ';
end;
I want to create a Childband (QB3) and a QRLabel (QL) at runtime. I just can't see it in my output, when I run the script in Delphi. When I change QL.Parent := QB3 to QB2, I see the output in QRBand2, but I want to see it in the just created Childband QB3. What do I wrong? I can not figure it out.
Thanks
This could be a solution:
This works (huray). But now the problem is: How do I get an array of childband.chhildband......childband. There is no Childband array like Childband[x]. Or is there one?? As I wrote there could be many Childbands [n]. It has to be dynamic, and... after printing the first childbands, they must be destroyed, before printing the next childbands for the next record (Artikel).