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

Create control at runtime

edited October 2003 in General
How do I do it?

i.e. insert a new label somewhere in the report...

Thanks

Comments

  • edited October 2003
    Hi,

    Here's a quick example of creating a label in code.

    uses
    ppCtrls;

    procedure TForm.CreateLabel;
    var
    lLabel: TppLabel;
    begin

    lLabel := TppLabel.Create(Self);
    lLabel.Band := aReport.GetBand(btHeader, 0);
    lLabel.Caption := 'Order Detail';
    lLabel.Left := 0.1042;
    lLabel.Top := 0.0937;

    lLabel.Font.Name := 'Arial';
    lLabel.Font.Size := 18;
    lLabel.Font.Style := [fsBold];

    end;

    ---------------------------------------------
    Tech Tip: Create Reports in Code
    ---------------------------------------------

    A ReportBuilder report is composed of a set
    of components. Like other standard Delphi
    components, the components which make up the
    report layout have a run-time interface.
    That is they can be created and configured
    using Object Pascal code.


    A complete example of creating a report entirely
    in code is contained in the Developers Guide.

    The Developers Guide is located in the
    ..\RBuilder\Developers Guide\ directory.


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.