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;

Comments

  • edited 3:11PM
    After using frxReport.datasets.add, adding a db (frxReport.datasets.add ('db')) will add a dataset to the selected database window each time FrxReport is opened, using frxreport.datasets.Delete ('db ') Or even the entire frxReport free off will not work
  • gpigpi
    edited 3:11PM
    Use TfrxReport. EngineOptions.UseGlobalDatasetsList = False

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.