How to increase the speed in Runtime?

It's slowly...

procedure TForm1.Button1Click(Sender: TObject);
var
LFXPCOM:TfrxPage;
LFXMCOM:TfrxMemoView;
i,j:integer;
begin
frxReport1.Clear;
LFXPCOM:=TfrxReportPage.Create(Self);
LFXPCOM.Parent:=frxReport1;
for i:=1 to 77 do
for j:=1 to 100 do
begin
LFXMCOM:=TfrxMemoView.Create(Self);
LFXMCOM.Parent:=LFXPCOM;
LFXMCOM.HAlign:=haCenter;
LFXMCOM.VAlign:=vaCenter;
LFXMCOM.Frame.Typ:= [ftLeft,ftRight,ftTop,ftBottom];
LFXMCOM.SetBounds(i*10,j*10,10,10);
LFXMCOM.Memo.Text:='A';
end;
frxReport1.ShowReport(true);
end;

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:13AM
    of course it is taking time you are creating 7700 objects.
    try this approach

    procedure TForm1.Button1Click(Sender: TObject);
    var
    LFXPCOM:TfrxPage;
    LFXMCOM:TfrxMemoView;
    databand:tfrxmasterdata;
    i,j:integer;
    begin
    frxReport4.Clear;
    LFXPCOM:=TfrxReportPage.Create(frxreport1);
    LFXPCOM.CreateUniqueName;
    ;
    DataBand := TfrxMasterData.Create(lfxpcom);
    DataBand.CreateUniqueName;
    DataBand.RowCount :=100;
    DataBand.Top := 10;
    DataBand.Height := 10;
    j:= 1;
    for i:=1 to 77 do
    begin
    LFXMCOM:=TfrxMemoView.Create(databand);
    LFXMCOM.CreateUniqueName;
    LFXMCOM.SetBounds(i*10,j*10,10,10);
    LFXMCOM.HAlign:=haCenter;
    LFXMCOM.VAlign:=vaCenter;
    LFXMCOM.Frame.Typ:= [ftLeft,ftRight,ftTop,ftBottom];
    LFXMCOM.Memo.Text:='A';
    end;

    frxreport1.ShowReport;
    end;

    ;)
  • edited 4:13AM
    Thank you very much! ;)
    My program had posted is just to explain that it's very slowly. In fact, I will set Memo different value with calculating result.
    It's very fast in FastReport 2.X even if I am creating 20000 objects. It takes no more than 10 seconds.
  • edited 4:13AM
    Are there any ways to improve the speed?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.