dbgrid关联至adoquery1 fastreport关联至adoquery2 在dbgrid的双击事件中打开adoquery2,语句为adoquery2.close; adoquery2.sql.clear; adoquery2.sql.add('select * from aa where id = '+adoquery1.fieldbyname('id').asstring);//ID为主自增型主键 adoquery2.open;接下来就是正常打印语句了。
frxReport1+frxDBDataset1+ADOQuery1; frxDBDataset1的DataSet属性设为ADOQuery1ADOQuery1查询选择的那一笔数据 select * from t where id='选中的Id'
fastreport关联至adoquery2
在dbgrid的双击事件中打开adoquery2,语句为adoquery2.close;
adoquery2.sql.clear;
adoquery2.sql.add('select * from aa where id = '+adoquery1.fieldbyname('id').asstring);//ID为主自增型主键
adoquery2.open;接下来就是正常打印语句了。
select * from t where id='选中的Id'