changing dataset at runtime?
Can anyone tell me how to change the dataset on a report at runtime? When I execute the following, I get undefined symbols on the database fields in the report.
procedure runreport(sql:string; repname:string);
var
  frDS: TfrDBDataSet;
  fr : TfrReport;
  repCDS : TClientDataSet;
begin
  repCDS := initcds; // function to create and initialise with soap info
  repCDS.CommandText := sql;
  repCDS.open;
  frDS := TfrDBDataSet.create(repCDS);
  frDS.DataSet := repCDS;
  frDS.name := 'frDBDataSet1';
  fr := TfrReport.create(repCDS);
  fr.loadfromfile(repname);
  fr.Dataset := frDS;
  (* something here to setup the report for the dataset - find what dataset used
    and replace*)
  fr.preparereport;
  fr.savepreparedreport(repname+'.frp');
end;
Comments
before the preparereport in my original message I added
now all I have to figure out is what are the original dataset names used in the report
when designed.
klint.