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

Creating a TppLabel at runtime

edited January 2013 in General
I have a known SubReport (CommentsSubReport) with only the Detail band
(ppDetailband1). I would like to populate the band with a series of TppLabel
at runtime. How would I do this correctly?

Thanks in advance.

Andy

Comments

  • edited January 2013
    Hi Andy,

    Adding a component to a report in code is simply a matter of creating
    the component, assigning its mandatory properties (top, left, height,
    width, caption), and finally assigning its Band property. This all
    needs to be done before the report is printed.

    lLabel := TppLabel.Create(Self);
    lLabel.Caption := 'My Label';
    lLabel.Top := 1.5;
    lLabel.Left := 1.5;
    lLabel.Width := 2;
    lLabel.Height := 0.5;
    lLabel.Band := ppReport.DetailBand;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2013
    Hi Nico,

    Thanks for the code snippet. It helped.

    Andy

This discussion has been closed.