Creating labels on the fly
I have tried creating labels to appear on a report as follows:
LBL: array[1 .. 15] of TppLabel;
I want to be able to position the labels by code
in the OnCreate event for the form where ppReport1 is my report
for i:=1 to 15 do
begin
LBL[i]:=TppLabel.Create(ppReport1);
end;
I can't get the labels to appear on my report
as a test I set one of the label properties as follows
LBL[1].Left:=0.42;
LBL[1].UserName:='LBL1';
LBL[1].Top:=1.95;
LBL[1].Width:=0.5;
LBL[1].Height:=0.2;
LBL[1].Font.Color:=clNavy;
LBL[1].Font.Size:=12;
LBL[1].Font.Style:=[fsBold];
LBL[1].Font.Name:='Arial';
LBL[1].Caption:='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
LBL[1].Visible:=true;
LBL[1].Transparent:=true;
LBL[1].Font.Charset:=DEFAULT_CHARSET;
LBL[1].Border.Visible:=false;
this was prior to ppReport1.print;
I'm running Delphi 7 and ver 9.02 of RB
LBL: array[1 .. 15] of TppLabel;
I want to be able to position the labels by code
in the OnCreate event for the form where ppReport1 is my report
for i:=1 to 15 do
begin
LBL[i]:=TppLabel.Create(ppReport1);
end;
I can't get the labels to appear on my report
as a test I set one of the label properties as follows
LBL[1].Left:=0.42;
LBL[1].UserName:='LBL1';
LBL[1].Top:=1.95;
LBL[1].Width:=0.5;
LBL[1].Height:=0.2;
LBL[1].Font.Color:=clNavy;
LBL[1].Font.Size:=12;
LBL[1].Font.Style:=[fsBold];
LBL[1].Font.Name:='Arial';
LBL[1].Caption:='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
LBL[1].Visible:=true;
LBL[1].Transparent:=true;
LBL[1].Font.Charset:=DEFAULT_CHARSET;
LBL[1].Border.Visible:=false;
this was prior to ppReport1.print;
I'm running Delphi 7 and ver 9.02 of RB
This discussion has been closed.
Comments
TWinControl).
--
Ed Dressel
Team DM