Assign more Datasources to Bands at runtime

Hi guys...
I have 3 TQuery components, I cannot active in designtime, only in runtime.
I designed my report, these Query components appear in the data dictionary, but when i create variables, the fieldnames of each query component does not show ovbviously...

My problem is:
When i add a masterdata band, the only datasource i can select is virtual dataset ...

How could i add a datasource to this band at runtime, before preparing report ?

I tried this but got an error of <span style='color:red'><span style='font-size:9pt;line-height:100%'>invalid class typecast</span></span>
var
  t: TfrBandView;
begin
  t := TfrBandView(Report.FindObject('myBand'));
  if t <> nil then
    t.DataSet := 'myDataSet';
  report.preparereport;
  report.showreport;

well, this code is for one of the query components...
i have 3 which i would like to show in report...

i know it could be done with tfrdbdataset ... but the report supports only 1...

any ideas ? thanks a lot

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.