Inefficiency code in Fast Report
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
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