Dynamic add datasets issue
hi
I added datasets dynamically in the code, but found that even after FreeAndNil Tfrxreport, the previously added dataset still resides in TFrxreport,any idea ?(Fastreport 5.4.6)
code is below :
try
aReport := TfrxReport.Create(nil);
aReport.Clear;
aReport.DataSets.Clear;
PrepareLabelDataset(aLBLMA, aReport); //dynamic add datasets
stream := TMemoryStream.Create;
fStream := TMemoryStream.Create;
stream := LabelController.GetLableFile(aLBLMA);
stream.Position := 0;
aReport.FileName := lFile;
aReport.LoadFromStream(stream);
aReport.DesignReport(true, false);
aReport.SaveToStream(fStream);
fStream.Position := 0;
LabelController.SaveLableFile(aLBLMA, fStream);
FreeAndNil(aReport); //even freeandnil the fastreport object still doesnt work
Result := true;
except
on e: Exception do
begin
Logger.FLog(e.Message, self.ClassName + '.')
end;
end;
I added datasets dynamically in the code, but found that even after FreeAndNil Tfrxreport, the previously added dataset still resides in TFrxreport,any idea ?(Fastreport 5.4.6)
code is below :
try
aReport := TfrxReport.Create(nil);
aReport.Clear;
aReport.DataSets.Clear;
PrepareLabelDataset(aLBLMA, aReport); //dynamic add datasets
stream := TMemoryStream.Create;
fStream := TMemoryStream.Create;
stream := LabelController.GetLableFile(aLBLMA);
stream.Position := 0;
aReport.FileName := lFile;
aReport.LoadFromStream(stream);
aReport.DesignReport(true, false);
aReport.SaveToStream(fStream);
fStream.Position := 0;
LabelController.SaveLableFile(aLBLMA, fStream);
FreeAndNil(aReport); //even freeandnil the fastreport object still doesnt work
Result := true;
except
on e: Exception do
begin
Logger.FLog(e.Message, self.ClassName + '.')
end;
end;
Comments