Change dataset in all objects on report
Hi!
i want to change dataset in all object on report in runtime. So I have folowing code ( from here)
But it does not loop through any MemoView on the report. Any ideas?
i want to change dataset in all object on report in runtime. So I have folowing code ( from here)
procedure ReportDatasetChange(Raport: TfrxReport; Dataset: TfrxDataset);
  var i,c: integer; component: TfrxComponent;
begin
  for i := 0 to Raport.PagesCount - 1 do begin
    for c := 0 to Raport.Pages[i].Objects.Count - 1 do begin
      component := tfrxComponent(Raport.Pages[i].Objects[c]);
      if component is tfrxMemoView then begin
        if tfrxMemoView(component).Dataset <> nil then // maybe <> nil, I didn't try compiling this code, I'm just posting it in the forum.
          tfrxMemoView(component).Dataset := Dataset;
        // maybe you need this too, test it:
        tfrxMemoView(component).text := '';
      end;
        //repeat situation for bands, or any other db type :
      if component is tfrxMasterData then
        tfrxMasterData(component).Dataset := Dataset
    end;
  end;
end;
But it does not loop through any MemoView on the report. Any ideas?
Comments