动态创建只要Query语句动态编写就好了,例子如下:
procedure TForm_Store.RzButton_AltInStoreBillPrintClick(Sender: TObject);
begin
ADOQuery_QuitStoreBill3.Close;
ADOQuery_QuitStoreBill3.SQL.Clear;
ADOQuery_QuitStoreBill3.SQL.Add('select * from t_head_quit_store_bill a,t_quit_store_bill b where a.QUIT_STORE_NUM='''+trim(RzEdit_QuitStoreNum.Text)+''' and a.QUIT_STORE_NUM=b.QUIT_STORE_NUM');
ADOQuery_QuitStoreBill3.Open;
frxReport_YaoFangQuit.ShowReport;
end;