Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Creating labels on the fly

edited December 2006 in General
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

Comments

  • edited December 2006
    try setting the labels Band proeprty (similar to the Parent property of a
    TWinControl).

    --
    Ed Dressel
    Team DM
  • edited December 2006
    that worked! thanks, LL
This discussion has been closed.