Inefficiency code in Fast Report

ccyccy
edited 11:29PM in FastReport 3.0
Hi,

I found Fast report did this:

constructor TfrxDataBand.Create(AOwner: TComponent);
begin
inherited;
FVirtualDataSet := TfrxUserDataSet.Create(nil);
FVirtualDataSet.RangeEnd := reCount;
end;

TfrxUserDataset is descendant of TfrxDataSet:

constructor TfrxDataSet.Create(AOwner: TComponent);
begin
inherited;
FEnabled := True;
FOpenDataSource := True;
FRangeBegin := rbFirst;
FRangeEnd := reLast;
DatasetList.Lock;
DatasetList.Add(Self);
DatasetList.Unlock;
end;

TfrxDataBand will be call many times when the preview pages are painting. It can easily make the DataSetList increase to few thousand objects. Is this some kind of bad coding done in FastReport?

Best regards,
Chau Chee Yang


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.