Recent

Author Topic: LazReport -make and copy pages runtime  (Read 1775 times)

benohb

  • Full Member
  • ***
  • Posts: 198
LazReport -make and copy pages runtime
« on: October 28, 2013, 07:36:37 pm »
I want to copy the first page to all new
See..
Code: [Select]
frReport1.LoadFromFile('./pa6.lrf');  <- one page

 for varb:=1 to 25 do begin
   frReport1.Pages.Add();
   frReport1.Pages.Pages[varb].Create(frReport1.Pages.Pages[0]); < -  no effect...!!!
end; 

Another attempt

Code: [Select]
procedure TForm1.Button2Click(Sender: TObject);
var index:integer;

  TStr:TLrXMLConfig ;
   hb:Integer;
begin
  TStr:=TLrXMLConfig.Create(self);
  frReport1.LoadFromFile('./pa6.lrf');
  frReport1.Pages.Pages[0].SavetoXML(TStr,'test');



   for hb:=1 to 3 do begin
   frReport1.Pages.Add();
   frReport1.Pages.Pages[hb].LoadFromXML(TStr,'test');
   frReport1.Pages.Pages[hb].Objects.AddList(frReport1.Pages.Pages[0].Objects);
   end;

end;
               
Succeeded ...but the problem of free memory

What is the correct way...?????

 

TinyPortal © 2005-2018