Hi, this is some code I use to dynamically make RBPro reports, hope it
helps:

  // Start by creating a blank report
  ReportCTab.Template.New;
  ReportCTab.CreateDefaultBands;

  // Change band heights
  ReportCTab.HeaderBand.Height := 0.1667 * 5;
  ReportCTab.DetailBand.Height := 0.1667;

  dLeft := 0.1;
  for iCount := 0 to dmReports.tReport.FieldCount - 1 do
  begin
    // Add a label component to the header band
    lLabel := TppLabel.Create(Self);
    lLabel.Band := ReportCTab.HeaderBand;
    lLabel.Font.Name := 'Arial';
    lLabel.Font.Size := 8;
    lLabel.Font.Style := [fsBold];

    cs.Text := dmReports.tReport.Fields[iCount].DisplayLabel;
    lLabel.Caption := '';
    for i := 0 to cs.Items.Count - 1 do
      lLabel.Caption := lLabel.Caption + #13#10 + cs.Items.Strings[i];

    lLabel.WordWrap := True;
    lLabel.Alignment := taRightJustify;

    lLabel.Top := 0.1;
    lLabel.Left := dLeft;

    dLeft := dLeft + lLabel.Width + 0.05;
  end;



-----Original Message-----
From: Willie Juson <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Date: Friday, 30 April 1999 10:27
Subject: [DUG]: R-Builder Pro - dynamic component creation


Does anyone know how to create pplabel components at run time.
I can TPPLabel.Create and do some stuff to it but can't get it to appear on
the report band when it prints.



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to