How to disconnect the use of global list of Datasets when using TfrxReport in a stream ?

Question: How to disconnect the use of global list of Datasets when using TfrxReport in a stream ?

Answer:

At default FastReport uses grobal Datasets list which are initialized in the module frxClass. After creating copies of TfrxDBDataset, it adds it them this list. In view of this, it’s not possible to use Datasets with the same name (Even in different streams). For using local Datasets , you need to use the following code :

1
2
3
4
frxReport.EngineOptions.UseGlobalDataSetList := False;
frxReport.EnabledDataSets.Clear();
frxReport.EnabledDataSets.Add(frxDataSet);
frxReport.LoadFromFile(ReportName);