Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: GaborBoros on September 15, 2017, 10:29:56 pm

Title: How to create a memo and assign to a band at runtime?
Post by: GaborBoros on September 15, 2017, 10:29:56 pm
Hi All,

I want to add  an Overlay to an existing complex report at runtime. The below code works but don't know how to specific explicitly the owner band of the memo.

Code: Pascal  [Select][+][-]
  1. var
  2.   b:TfrBandView;
  3.   m:TfrMemoView;
  4.  
  5. begin
  6.   b:=TfrBandView.Create(MyReport.Pages[0]);
  7.   b.CreateUniqueName;
  8.   b.BandType:=btOverlay;
  9.   b.SetBounds(0,30,0,50);
  10.  
  11.   m:=TfrMemoView.Create(MyReport.Pages[0]);
  12.   m.CreateUniqueName;
  13.   m.SetBounds(30,40,50,20);
  14.   m.Memo.Text:='Memo1';

Gabor
Title: Re: How to create a memo and assign to a band at runtime?
Post by: taazz on September 15, 2017, 10:37:07 pm
Bands do not own objects or parent them they choose the controls that are placed on top of them at design time. So make sure the setbounds call places it on top of the band you want.
TinyPortal © 2005-2018