I have created a report using FastReport Designer and calling it using Delphi 6. But DataSet for the MasterData and the fields is not assinged at design time. I want to set these properties at runtime based on the selected DataSet. How can I do that? How can I access the DataSet of the MasterData in Delphi before calling the preview/print/design? Added following code in frxReport1BeforePrint.

  t := frxReport1.FindObject('MasterData1') as TfrxMasterData;
  //if Assigned(t) then
    //t.DataSet := frxIBODataset1;

  m := frxReport1.FindObject('mTenderType') as TfrxMemoView;
  if Assigned(m) then
  begin
    m.DataSet := frxIBODataset1;
    m.DataField := 'ACCOUNTNAME';
    m.Text := '[frxIBODataset1."ACCOUNTNAME"]';
  end;

But I need to set these properties before calling the print/design/preview. Any help is appreciated.

Edit
Report